#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sm = 0, ans;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i], sm += a[i];
  ans = sm;
  sort(a, a + n);
  int m = a[0];
  int inc = 0, dec = 0, mn = sm;
  for (int i = n - 1; i >= 1; i--) {
    for (int j = a[i] / 2; j >= 1; j--) {
      sm = ans;
      if (a[i] % j == 0) {
        inc = m * (j)-m;
        dec = a[i] - a[i] / j;
        sm -= dec;
        sm += inc;
        mn = min(sm, mn);
      }
    }
  }
  cout << mn << endl;
  return 0;
}
