#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> four = {{-1, 0}, {0, -1}, {0, 1}, {1, 0}};
vector<pair<int, int>> eight = {{-1, -1}, {-1, 0}, {-1, 1}, {0, -1},
                                {0, 1},   {1, -1}, {1, 0},  {1, 1}};
void solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  int sum = 0;
  int mi = INT_MAX;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    mi = min(mi, v[i]);
    sum += v[i];
  }
  int ans = sum;
  for (int i = 0; i < n; i++) {
    vector<int> mult;
    for (int j = 2; j * j <= v[i]; j++) {
      if (v[i] % j == 0) {
        mult.push_back(j);
      }
    }
    for (int j = 0; j < mult.size(); j++) {
      int mx = mult[j];
      int ts = (mi * mx - mi) - (v[i] - v[i] / mx);
      ans = min(ans, sum + ts);
    }
  }
  cout << ans << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
