#include <bits/stdc++.h>
using namespace std;
const long long int logx = 30;
const long long int M = 3e2 + 5;
const long long int N = 2e6 + 5;
const long long int INF = 1e18;
const long long int mod = 1e9 + 7;
const double PI = 3.14159265358979323846;
template <typename T>
T power(T x, T y, long long int m) {
  T ans = 1;
  while (y > 0) {
    if (y & 1LL) ans = (ans * x) % m;
    y >>= 1ll;
    x = (x * x) % m;
  }
  return ans % m;
}
vector<long long int> fac[105];
void DIV(long long int n) {
  for (long long int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i) {
        fac[n].push_back(i);
      } else {
        fac[n].push_back(i);
        fac[n].push_back(n / i);
      }
    }
  }
}
int main() {
  long long int n;
  cin >> n;
  long long int a[n];
  long long int sum = 0;
  set<long long int> second;
  long long int fmini = INF;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    second.insert(a[i]);
    sum += a[i];
  }
  for (auto i : second) {
    DIV(i);
  }
  fmini = sum;
  for (auto i : second) {
    for (auto j : fac[i]) {
      long long int mini = INF, temp = sum;
      for (auto h : second) {
        mini = min(mini, h * j);
      }
      long long int rem = mini / j;
      temp -= rem;
      temp += mini;
      rem = i;
      temp -= rem;
      temp += (i / j);
      fmini = min(fmini, temp);
    }
  }
  cout << fmini << endl;
}
