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