#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (auto& e : v) cin >> e;
  int min_elem = *min_element(v.begin(), v.end());
  int suma = accumulate(v.begin(), v.end(), 0), min_suma = suma;
  for (auto e : v) {
    for (int i = 2; i <= e; i++) {
      if (e % i == 0) {
        min_suma = min(min_suma, suma - e - min_elem + e / i + min_elem * i);
      }
    }
  }
  cout << min_suma;
  return 0;
}
