#include <bits/stdc++.h>
using namespace std;
unordered_map<long long, long long> hm;
int main() {
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n], sm = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      sm += a[i];
    }
    sort(a, a + n);
    long long x = 100;
    long long mn = 1000000000;
    while (x > 0) {
      for (long long i = 1; i < n; i++) {
        if (a[i] % x == 0) {
          mn = min(mn, (a[i] / x) + (a[0] * (x)) - a[i] + sm - a[0]);
        }
      }
      x--;
    }
    cout << mn << endl;
  }
  return 0;
}
