#include <bits/stdc++.h>
using namespace std;
vector<int> a;
int main() {
  int n;
  cin >> n;
  a.resize(n);
  long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  long max_sum = sum;
  sort(a.begin(), a.end());
  ;
  for (int j = 1; j < n; j++) {
    for (int k = 1; k <= a[j]; k++) {
      if (a[j] % k == 0) {
        long new_sum = sum - a[j] - a[0] + a[j] / k + a[0] * k;
        if (new_sum < max_sum) max_sum = new_sum;
      }
    }
  }
  cout << max_sum << endl;
}
