#include <bits/stdc++.h>
using namespace std;
vector<int> getdiv(int n) {
  vector<int> ans;
  ans.push_back(n);
  ans.push_back(1);
  for (int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        ans.push_back(i);
      else {
        ans.push_back(i);
        ans.push_back(n / i);
      }
    }
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  int a[n];
  long long sum = 0;
  int minel = 1000;
  int minind = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
    if (a[i] < minel) {
      minel = a[i];
      minind = i;
    }
  }
  long long tsum = sum;
  int mi = sum;
  for (int i = 0; i < n; i++) {
    if (i == minind) continue;
    vector<int> div = getdiv(a[i]);
    for (auto x : div) {
      tsum -= a[i];
      tsum += a[i] / x;
      tsum -= minel;
      tsum += minel * x;
      if (tsum < mi) mi = tsum;
      tsum = sum;
    }
  }
  cout << mi << endl;
  return 0;
}
