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