#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if (argc == 2 && atoi(argv[1]) == 123456789)
    freopen("d:\\code\\cpp\\stdin", "r", stdin);
  int n;
  cin >> n;
  vector<int> a(n);
  long long sum = 0;
  for (int(i) = 0; (i) < (n); (i)++) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a.begin(), a.end());
  if (n == 1) {
    cout << a[0];
    return 0;
  }
  long long sol = sum;
  int j = -1;
  for (int(i) = 0; (i) < (n); (i)++) {
    if (i == 0)
      j = 1;
    else
      j = 0;
    for (int d = 1; d * d <= a[i]; d++) {
      if (a[i] % d == 0) {
        sol = min(sol, sum - a[i] - a[j] + a[i] / d + a[j] * d);
        int d2 = a[i] / d;
        sol = min(sol, sum - a[i] - a[j] + a[i] / d2 + a[j] * d2);
      }
    }
  }
  cout << sol;
  return 0;
}
