#include <bits/stdc++.h>
using namespace std;
long long a[1000007];
long long calc(long long ans, long long x, long long d) {
  ans = ans - a[1] + a[1] * d - x + x / d;
  return ans;
}
int main() {
  long long n, v, ans, i, j, sum;
  cin >> n;
  ans = 0;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    ans += a[i];
  }
  sum = ans;
  sort(a + 1, a + n + 1);
  for (i = 2; i <= n; i++) {
    for (j = 1; j * j <= a[i]; j++) {
      if (a[i] % j == 0) {
        ans = min(ans, calc(sum, a[i], j));
        ans = min(ans, calc(sum, a[i], a[i] / j));
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
