#include <bits/stdc++.h>
using namespace std;
const long long mx = 1000009;
const long long inf = 100000000000000;
long long arr[mx], freq[mx];
bool sign[mx];
vector<long long> vec;
map<long long, long long> mp;
int32_t main() {
  long long tc, n, m, a, b, k, p = 0, q, x, y, sum = 0, maxi = 0, mini = inf;
  string s1, s2;
  bool f1 = false, f2 = false;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> arr[i];
    sum += arr[i];
    vec.push_back(arr[i]);
  }
  sort(vec.begin(), vec.end());
  for (long long i = vec.size() - 1; i >= 0; i--) {
    for (long long j = sqrt(vec[i]); j >= 2; j--) {
      if (vec[i] % j == 0) {
        x = (vec[i] - (vec[i] / j)) - ((vec[0] * j) - vec[0]);
        maxi = max(maxi, x);
      }
    }
  }
  cout << sum - maxi << endl;
}
