#include <bits/stdc++.h>
using namespace std;
long long modexpo(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1) res = (res * a) % 1000000007;
    b = b / 2;
    a = (a * a) % 1000000007;
  }
  return res;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long freq[105];
  for (long long i = 0; i < 105; i++) freq[i] = 0;
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    freq[x]++;
    sum = sum + x;
  }
  long long ans = LLONG_MAX;
  ans = sum;
  for (long long i = 100; i >= 2; i--) {
    if (freq[i] == 0) continue;
    vector<long long> div;
    for (long long j = 2; j * j <= i; j++) {
      if (i % j == 0) {
        div.push_back(j);
        if (j * j != i) div.push_back(i / j);
      }
    }
    for (long long k = 0; k < div.size(); k++) {
      if (div[k] == 1) continue;
      for (long long j = 1; j <= 100; j++) {
        if (freq[j]) {
          long long temp = sum - j + j * div[k] - i + i / div[k];
          ans = min(ans, temp);
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
