#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
const long long N = 5e5 + 100;
const double pi = 3.14159265358979323846264338327950288419716939937510;
long long sq(long long a) { return a * a; }
void solve() {
  long long n, sum = 0;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i], sum += a[i];
  long long ans = sum;
  for (long long x = 2; x <= 100; ++x) {
    long long mn = inf, mx = 0;
    for (long long i = 0; i < n; ++i) {
      if (a[i] % x == 0) {
        mx = max(mx, a[i]);
      }
      mn = min(mn, a[i]);
    }
    if (mx) ans = min(ans, sum - mx + mx / x + mn * (x - 1));
  }
  cout << ans;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long TTT = 1;
  while (TTT--) {
    solve();
    cout << '\n';
  }
}
