#include <bits/stdc++.h>
using namespace std;
const int N = 5e4 + 2;
vector<int> v[N];
int a[N];
int main() {
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    int x = a[i];
    for (int j = 1; j * j <= x; j++) {
      if (x % j == 0) {
        int p = j, q = x / j;
        v[i].push_back(p);
        if (p != q) v[i].push_back(q);
      }
    }
    sum += a[i];
  }
  int ans = sum;
  for (int i = 1; i < n; i++) {
    for (auto x : v[i]) {
      int novo = a[i] / x;
      int novo2 = a[0] * x;
      int quita = (a[i] - novo) + (a[0] - novo2);
      ans = min(ans, sum - quita);
    }
  }
  cout << ans << endl;
  return 0;
}
