#include <bits/stdc++.h>
using namespace std;
long long int M = 100000000000000;
long long int M1 = 1000000007;
int main() {
  int n, i, mn, diff, sum, j, x1, x2;
  cin >> n;
  vector<int> v(n);
  for (i = 0; i < n; i++) cin >> v[i];
  mn = *min_element(v.begin(), v.end());
  diff = 0;
  sum = 0;
  for (i = 0; i < n; i++) sum += v[i];
  for (i = 0; i < n; i++) {
    x1 = v[i];
    for (j = 1; j * j <= x1; j++) {
      if (x1 % j == 0) {
        x2 = x1 / j;
        diff = max(diff, v[i] - v[i] / j - (mn * (j)) + mn);
        diff = max(diff, v[i] - v[i] / x2 - (mn * (x2)) + mn);
      }
    }
  }
  sum = sum - diff;
  cout << sum << endl;
}
