#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n;
  cin >> n;
  int a[n];
  int ans = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ans += a[i];
  }
  sum = ans;
  sort(a, a + n);
  for (int j = n - 1; j >= 1; j--) {
    for (int x = 2; x < a[j]; x++) {
      if (a[j] % x != 0) continue;
      ans = min(ans, sum - a[j] - a[0] + a[j] / x + a[0] * x);
    }
  }
  cout << ans << endl;
  cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s"
       << "\n";
  return 0;
}
