#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n], sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  vector<long long> v;
  sort(a, a + n);
  v.push_back(a[0]);
  for (long long i = 1; i < n; i++) {
    if (a[i] != a[i - 1]) {
      v.push_back(a[i]);
    }
  }
  if (v.size() == 1) {
    cout << sum << endl;
    return 0;
  }
  long long ans = LLONG_MAX;
  for (long long i = 0; i < v.size(); i++) {
    for (long long j = i + 1; j < v.size(); j++) {
      for (long long k = 1; k <= 100; k++) {
        if (v[j] % k == 0)
          ans = min(ans, (v[j] / k) + (v[i] * k) - (v[j] + v[i]));
        if (v[i] % k == 0)
          ans = min(ans, (v[i] / k) + (v[j] * k) - (v[j] + v[i]));
      }
    }
  }
  cout << sum + ans;
  return 0;
}
