#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  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];
  }
  sort(a.begin(), a.end());
  long long g = a[n - 1] / a[0] + 1;
  long long maxi, mini;
  mini = sum;
  for (long long i = 2; i <= g; i++) {
    maxi = -1;
    long long u = 0;
    for (long long j = 0; j < n; j++) {
      if (a[j] % i == 0) {
        u = i;
        maxi = max(a[j], maxi);
      }
    }
    if (a[0] * u < maxi) {
      long long delta = (maxi + a[0]) - (maxi / u + a[0] * u);
      mini = min(mini, sum - delta);
    }
  }
  cout << mini;
  return 0;
}
