#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 9;
long long MOD = 1e9 + 7;
const long long inf = 2e18;
const int maxn = 200005;
const int maxa = 300005;
long long print_array(long long a[], int t) {
  cout << "[";
  for (int i = 0; i < t; i++) {
    cout << a[i];
    if (i != t - 1) cout << ", ";
  }
  cout << "]" << endl;
  return 0;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  if (b < 0) return -1;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long powmod2(long long a, long long b) {
  long long res = 1;
  a %= MOD;
  if (b < 0) return -1;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % MOD;
    a = a * a % MOD;
  }
  return res;
}
int a[maxn];
int main() {
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; i++) cin >> a[i];
  int minn = 105;
  for (int i = 0; i < n; i++) {
    minn = min(a[i], minn);
    sum += a[i];
  }
  int del = 0;
  for (int i = 0; i < n; i++) {
    int tmp = a[i];
    for (int j = 2; j <= a[i]; j++) {
      if (a[i] % j == 0) {
        del = max(tmp - tmp / j - minn * (j - 1), del);
      }
    }
  }
  cout << sum - del;
}
