#include <bits/stdc++.h>
using namespace std;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr), cout.tie(nullptr);
int n;
cin >> n;
vector<int> a(n);
for(int i = 0; i < n; ++i) {
cin >> a[i];
}
int mn = *min_element(a.begin(), a.end());
int sum = accumulate(a.begin(), a.end(), 0);
int res = sum;
for(int i = 0; i < n; ++i) {
for(int d = 1; d <= a[i]; ++d) {
if (a[i] % d != 0) continue;
int cur = sum - mn - a[i];
cur += mn * d + a[i] / d;
res = min(res, cur);
}
}
cout << res << endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgoKaW50MzJfdCBtYWluKCkgewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CiAgICBjaW4udGllKG51bGxwdHIpLCBjb3V0LnRpZShudWxscHRyKTsKICAgIAogICAgaW50IG47CiAgICBjaW4gPj4gbjsKICAgIHZlY3RvcjxpbnQ+IGEobik7CiAgICBmb3IoaW50IGkgPSAwOyBpIDwgbjsgKytpKSB7CiAgICAgICAgY2luID4+IGFbaV07CiAgICB9CiAgICBpbnQgbW4gPSAqbWluX2VsZW1lbnQoYS5iZWdpbigpLCBhLmVuZCgpKTsKICAgIGludCBzdW0gPSBhY2N1bXVsYXRlKGEuYmVnaW4oKSwgYS5lbmQoKSwgMCk7CiAgICBpbnQgcmVzID0gc3VtOwogICAgZm9yKGludCBpID0gMDsgaSA8IG47ICsraSkgewogICAgICAgIGZvcihpbnQgZCA9IDE7IGQgPD0gYVtpXTsgKytkKSB7CiAgICAgICAgICAgIGlmIChhW2ldICUgZCAhPSAwKSBjb250aW51ZTsKICAgICAgICAgICAgaW50IGN1ciA9IHN1bSAtIG1uIC0gYVtpXTsKICAgICAgICAgICAgY3VyICs9IG1uICogZCArIGFbaV0gLyBkOwogICAgICAgICAgICByZXMgPSBtaW4ocmVzLCBjdXIpOwogICAgICAgIH0KICAgIH0KICAgIGNvdXQgPDwgcmVzIDw8IGVuZGw7CgogICAgcmV0dXJuIDA7Cn0K