#include <bits/stdc++.h>
using namespace std;
int _I() {
  int x;
  scanf("%d", &x);
  return x;
}
string s;
void solve() {
  int n = _I();
  int ar[100001];
  int mn = INT_MAX;
  int ans = INT_MAX;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    int x = _I();
    sum += x;
    ar[i] = x;
    mn = min(x, mn);
  }
  for (int i = 0; i < n; i++) {
    int sq = sqrt(ar[i]);
    for (int j = 1; j <= sq; j++) {
      if (ar[i] % j == 0) {
        int nm = sum;
        int d1 = j;
        int d2 = ar[i] / j;
        nm -= ar[i];
        nm -= mn;
        ans = min(ans, nm + d2 + (mn * d1));
        ans = min(ans, nm + d1 + (mn * d2));
      }
    }
  }
  printf("%d\n", ans);
}
int main() {
  solve();
  return 0;
}
