#include <bits/stdc++.h>
using namespace std;
long long v, n, arr[50005], ans, o = 9999, minans;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    v = max(arr[i], v);
    o = min(arr[i], o);
    ans += arr[i];
  }
  minans = ans;
  for (int x = 1; x <= n; x++) {
    for (int i = 1; i <= v; i++) {
      if (arr[x] % i == 0) {
        long long nowc = arr[x] / i - arr[x] + o * (i - 1);
        minans = min(minans, ans + nowc);
      }
    }
  }
  cout << minans;
  return 0;
}
