#include <bits/stdc++.h>
using namespace std;
long long int power(long long int n, long long int m) {
  if (m == 0) return 1;
  long long int t = power(n, m / 2);
  if (m % 2 == 0) return (t * t);
  return (((t * t)) * n);
}
long long int logtwo(long long int n) {
  if (n == 1) return 0;
  return logtwo(n / 2) + 1;
}
long long int gcd(long long int a, long long int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
string itb(long long int n) {
  string s = "";
  while (n > 0) {
    long long int d = n % 2;
    s = (char)(d + 48) + s;
    n = n / 2;
  }
  return s;
}
long long int bti(string s) {
  long long int ans = 0, n = s.length();
  for (int i = 0; i < n; i++) {
    ans += (int)(s[n - 1 - i] - 48) * power(2, i);
  }
  return ans;
}
int main() {
  long long int n, i, sum = 0, j, g, largest, minimum, x;
  cin >> n;
  long long int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  minimum = sum;
  sort(a, a + n);
  vector<long long int> v;
  for (j = 1; j < n; j++) {
    for (i = 2; i <= a[j] / 2 + 1; i++) {
      if (a[j] % i == 0) {
        x = a[0] * i + a[j] / i + sum - a[0] - a[j];
        minimum = min(x, minimum);
      }
    }
  }
  cout << minimum;
  return 0;
}
