#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long fac(long long n) {
  if (n == 1) return 1;
  return n * fac(n - 1);
}
long long power(long long x, long long y) {
  long long res = 1;
  for (long long i = 1; i <= y; i++) res = (res * x) % 1000000007;
  return res % 1000000007;
}
int32_t main() {
  long long T = 1;
  while (T--) {
    long long n, v;
    cin >> n;
    long long a[n];
    long long sum = 0;
    for (long long i = 0; i < n; i++) cin >> a[i], sum += a[i];
    sort(a, a + n);
    long long ans = sum;
    for (long long i = 1; i < n; i++) {
      for (long long x = 2; x <= a[i]; x++) {
        if (a[i] % x == 0) {
          long long s = sum - (a[i] + a[0]) + (a[i] / x + a[0] * x);
          ans = min(ans, s);
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
