#include <bits/stdc++.h>
using namespace std;
void stress();
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  stress();
}
void stress() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  long long mn = 100;
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    mn = min(mn, a[i]);
    sum += a[i];
  }
  long long ans = sum;
  for (long long i = 0; i < n; i++) {
    if (a[i] == mn) continue;
    for (long long j = 2; j < a[i]; j++) {
      if (a[i] % j == 0) {
        long long old1 = a[i] / j;
        long long new1 = mn * j;
        long long newsum = sum - a[i] + old1 - mn + new1;
        ans = min(newsum, ans);
      }
    }
  }
  cout << ans;
}
