#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, ans, sum = 0, j;
  cin >> n;
  long long arr[n];
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  sort(arr, arr + n);
  ans = sum;
  for (i = 1; i < n; i++) {
    for (j = 2; j < arr[i] / 2 + 1; j++) {
      if (arr[i] % j == 0) {
        ans = min(ans, sum - arr[i] - arr[0] + arr[i] / j + arr[0] * j);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
