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