#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k;
  cin >> n;
  long long int a[n], i, sum = 0, sum1 = 0;
  for (i = 0; i < n; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a + n);
  sum1 = sum;
  long long int j = n - 1, num = 0, num1 = 0, m = INT_MAX;
  i = 0;
  int f = 0;
  while (j != 0) {
    num = 0;
    f = 0;
    for (k = 2; k <= sqrt(a[j]); k++) {
      if (a[j] % k == 0) {
        if ((k * a[i]) + (a[j] / k) < a[j] + a[i]) {
          sum1 = sum;
          sum1 -= a[j];
          sum1 -= a[i];
          sum1 += a[j] / k;
          sum1 += a[i] * k;
          if (sum1 < sum) {
            if (m > sum1) {
              m = sum1;
              f = 1;
            }
          }
        }
        num1 = a[j] / k;
        if (num1 != k) {
          if ((num1 * a[i]) + (a[j] / num1) < a[j] + a[i]) {
            sum1 = sum;
            sum1 -= a[j];
            sum1 -= a[i];
            sum1 += a[j] / num1;
            sum1 += a[i] * num1;
            if (sum1 < sum) {
              if (m > sum1) {
                m = sum1;
                f = 1;
              }
            }
          }
        }
      }
    }
    j--;
  }
  cout << min(m, sum);
  return 0;
}
