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