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