#include <bits/stdc++.h>
using namespace std;
void no() { cout << "NO"; }
void yes() { cout << "YES"; }
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long n;
  cin >> n;
  long long arr[n + 1];
  for (long long i = 1; i <= n; i++) cin >> arr[i];
  sort(arr + 1, arr + 1 + n);
  long long mn = 9999999999999999;
  long long sum = 0;
  for (long long i = 1; i <= n; i++) sum += arr[i];
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= arr[i]; j++) {
      if (arr[i] % j == 0) {
        long long p = arr[1] * j;
        long long q = arr[i] / j;
        long long r = sum - arr[i] - arr[1] + p + q;
        mn = min(mn, r);
      }
    }
  }
  cout << mn;
  return 0;
}
