#include <bits/stdc++.h>
using namespace std;
long long modexpo(long long x, long long p) {
  long long res = 1;
  x = x % 1000000007;
  while (p) {
    if (p % 2) res = res * x;
    p >>= 1;
    x = x * x % 1000000007;
    res %= 1000000007;
  }
  return res;
}
long long max(long long a, long long b) { return (a > b ? a : b); }
long long min(long long a, long long b) { return (a < b ? a : b); }
struct compare {
  bool operator()(const pair<long long, long long> a,
                  const pair<long long, long long> b) const {
    return a.first < b.first;
  }
};
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long arr[n];
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  long long ans = sum;
  long long mn = *min_element(arr, arr + n);
  for (long long i = 0; i < n; i++) {
    for (long long j = 1; j * j <= arr[i]; j++) {
      if (arr[i] % j == 0) {
        long long x = arr[i] / j;
        long long y = mn * j;
        long long temp = sum - arr[i] - mn + x + y;
        if (temp < ans) {
          ans = temp;
        }
        temp = sum - arr[i] - mn + j + (mn * x);
        if (temp < ans) {
          ans = temp;
        }
      }
    }
  }
  cout << ans << endl;
}
