#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, z;
  cin >> n;
  vector<long long> d[101];
  for (i = 1; i <= 100; i++) d[i].push_back(1);
  for (i = 2; i <= 100; i++)
    for (j = i; j <= 100; j += i) d[j].push_back(i);
  long long v[n];
  z = 0;
  for (i = 0; i < n; i++) {
    cin >> v[i];
    z += v[i];
  }
  sort(v, v + n);
  long long x, k, an;
  an = 0;
  for (i = n - 1; i >= 0; i--) {
    for (auto it : d[v[i]]) {
      x = v[i] / it;
      x += v[0] * it;
      k = v[0] + v[i];
      an = min(an, x - k);
    }
  }
  cout << z + an;
  return 0;
}
