#include <bits/stdc++.h>
using namespace std;
long long inf = -1e10;
long long isprime(long long n) {
  if (n == 2) return 1;
  if (n == 1 || (n != 2 && n % 2 == 0)) return 0;
  long long i;
  for (i = 3; i * i <= n; i += 2) {
    if (n % i == 0) {
      return 0;
      break;
    }
  }
  return 1;
}
int main() {
  long long n, m, i, j, mn = 1e9, la, ka, p;
  cin >> n;
  long long a[n];
  for (auto& i : a) cin >> i;
  sort(a, a + n);
  long long pp = accumulate(a, a + n, 0);
  long long o = *min_element(a, a + n);
  for (i = 1; i < n; i++) {
    for (j = 1; j <= a[i]; j++) {
      if (a[i] % j == 0) p = pp - o - a[i] + (o * j) + a[i] / j;
      mn = min(p, mn);
    }
  }
  cout << mn;
}
