#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, i, x, ans, sum = 0, val;
  cin >> n;
  set<int> s;
  for (i = 0; i < n; i++) {
    cin >> val;
    s.insert(val);
    sum += val;
  }
  ans = sum;
  long long int mmin = *s.begin();
  auto it = next(s.begin());
  while (it != s.end()) {
    for (x = 2; x * x <= *it; x++) {
      if (*it % x == 0) {
        val = sum - *it - mmin + x * mmin + *it / x;
        ans = min(ans, val);
        val = sum - *it - mmin + (*it / x) * mmin + x;
        ans = min(ans, val);
      }
    }
    it++;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
}
