#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int ans = 0, n, res = INT_MAX;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ans += a[i];
  }
  vector<int> v;
  sort(a, a + n);
  v.push_back(a[0]);
  for (int i = 1; i < n; i++) {
    if (a[i] != a[i - 1]) v.push_back(a[i]);
  }
  int temp = INT_MAX;
  for (int i = 1; i < v.size(); i++) {
    for (int j = 2; j < v[i]; j++) {
      if (v[i] % j == 0) {
        temp = (j - 1) * (v[0] - (v[i] / j));
        res = min(res, temp);
      }
    }
  }
  if (res < 0)
    cout << ans + res;
  else
    cout << ans;
  return 0;
}
