#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  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];
  }
  sort(arr, arr + n);
  long long st = arr[0];
  long long ans = sum;
  for (long long i = 1; i < n; i++) {
    long long num = arr[i];
    for (long long j = 1; j * j <= num; j++) {
      if (num % j == 0) {
        long long f = j;
        long long s = num / j;
        long long curr = sum - (arr[i] + st) + (arr[i] / f + st * f);
        ans = min(ans, curr);
        curr = sum - (arr[i] + st) + (arr[i] / s + st * s);
        ans = min(ans, curr);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
