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