#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a[n], sum = 0, mi = 99999999;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
    mi = min(mi, a[i]);
  }
  int ans = sum;
  for (int i = 0; i < n; i++) {
    for (int j = 1; j <= a[i]; j++) {
      if (a[i] % j == 0) {
        int d = sum - mi;
        d += mi * j;
        d -= a[i];
        d += a[i] / j;
        ans = min(ans, d);
      }
    }
  }
  cout << ans;
  return 0;
}
