#include <bits/stdc++.h>
using namespace std;
const long long maxx = 790;
const long long maxn = 50000 + 7;
const long long mod = 998244353;
const long long maxs = 500000 + 7;
const long long maxm = 400000 + 7;
const long long maxk = 1008 + 7;
const long long maxw = 100 + 7;
const long long maxh = 100 + 7;
const double pi = 3.1415926;
const long long ten = 10;
const long long ooi = 1e9 + 7;
const long long ool = 1e18 + 7;
const long double eps = 1e-8;
const int apsz = 26;
vector<int> seq;
vector<int> fa[100 + 7];
int n;
void init() {
  cin >> n;
  seq = vector<int>(n);
  for (long long i = (0); i < (n); i++) cin >> seq[i];
  sort(seq.begin(), seq.end());
  for (long long i = (1); i < (101); i++) {
    int tp = i;
    fa[i].push_back(i);
    if (i != 1) fa[i].push_back(1);
    for (int j = 2; j * j <= i; j++) {
      if (i % j) continue;
      fa[i].push_back(j);
      if (i / j == j) continue;
      fa[i].push_back(i / j);
    }
  }
}
int sum = 0;
int deal(int p1) {
  int ans = ooi;
  int yu1 = seq[p1];
  int wgr = seq[0];
  for (int x : fa[yu1]) {
    int tp = 0;
    tp -= (yu1 * (x - 1)) / x;
    tp += (wgr * (x - 1));
    ans = min(sum + tp, ans);
  }
  return ans;
}
void solve() {
  for (int x : seq) sum += x;
  int p1 = n - 1;
  int ans = ooi;
  while (p1 >= 0) {
    ans = min(ans, deal(p1));
    p1--;
  }
  cout << ans << endl;
}
int main(void) {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  init();
  solve();
  return 0;
}
