#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double PI = 3.141592653589793238462643383279;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 55;
vector<ll> divisor(ll n) {
  vector<ll> ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i != n / i) ret.push_back(n / i);
    }
  }
  return move(ret);
}
signed main() {
  ll N;
  cin >> N;
  ll A[N];
  ll min_v = INF;
  ll s = 0;
  for (ll i = 0; i < N; i++) {
    cin >> A[i];
    min_v = min(min_v, A[i]);
    s += A[i];
  }
  ll diff = INF;
  for (ll i = 0; i < N; i++) {
    vector<ll> divs = divisor(A[i]);
    for (ll div : divs) {
      ll tmp_diff = (A[i] / div - A[i]) + (min_v * div - min_v);
      diff = min(tmp_diff, diff);
    }
  }
  cout << s + diff << endl;
  return 0;
}
