#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> v(n);
  int orig_sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    orig_sum += v[i];
  }
  sort(v.begin(), v.end());
  int sum = orig_sum;
  for (int x = 2; x <= v[n - 1]; x++) {
    int min_inc = v[0] * (x - 1);
    int max_dec = 0;
    for (int i = 1; i < n; i++) {
      if (v[i] % x == 0) max_dec = max(max_dec, v[i] - v[i] / x);
    }
    sum = min(sum, orig_sum - max_dec + min_inc);
  }
  cout << sum << endl;
  return 0;
}
