#include <bits/stdc++.h>
#pragma comment(linker, "/stack:256000000")
using namespace std;
long long const maxn = 3e5 + 5;
mt19937_64 gen(time(NULL));
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n);
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (n == 1) {
    cout << sum << endl;
  } else {
    vector<pair<long long, long long>> b(n);
    for (long long i = 0; i < n; i++) {
      b[i] = {a[i], i};
    }
    sort(begin(b), end(b));
    long long posmn1 = b[0].second;
    long long posmn2 = b[1].second;
    long long ans = sum;
    for (long long i = 0; i < n; i++) {
      long long t = a[i];
      for (long long d = 2; d <= a[i]; d++) {
        if (a[i] % d) continue;
        if (i != posmn1) {
          ans = min(ans, sum - a[i] - a[posmn1] + a[i] / d + a[posmn1] * d);
        } else {
          if (i != posmn2) {
            ans = min(ans, sum - a[i] - a[posmn2] + a[i] / d + a[posmn2] * d);
          }
        }
      }
    }
    cout << ans;
  }
  return 0;
}
