#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, l, r, temp, i, ans = 0, x, a[100005];
  cin >> n;
  vector<long long int> v[101];
  for (i = 1; i <= 100; i++) {
    for (l = 2; l <= 50 && l <= i / 2; l++) {
      if (i % l == 0) {
        v[i].push_back(l);
      }
    }
  }
  for (i = 0; i < n; i++) {
    cin >> a[i];
    ans += a[i];
  }
  sort(a, a + n);
  r = -1;
  for (i = 1; i < n; i++) {
    for (l = 0; l < v[a[i]].size(); l++) {
      x = v[a[i]][l];
      temp = (x - 1) * (a[i] / x - a[0]);
      r = max(r, temp);
    }
  }
  if (r > 0) ans = ans - r;
  cout << ans << endl;
}
