#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long arr[n];
  long long s = 0;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    s += arr[i];
  }
  map<long long, vector<long long> > divs;
  for (long long i = 1; i <= 100; i++) {
    divs.insert(pair<long long, vector<long long> >(i, vector<long long>()));
    for (long long j = 1; j <= i; j++) {
      if (i % j == 0) {
        divs[i].push_back(j);
      }
    }
  }
  sort(arr, arr + n, greater<long long>());
  long long ans = s;
  for (long long i = 0; i < n; i++) {
    if (divs[arr[i]].size() > 2) {
      for (long long j = 0; j < divs[arr[i]].size(); j++) {
        long long temp = s;
        temp = temp - arr[n - 1] - arr[i];
        temp =
            temp + (arr[i] / divs[arr[i]][j]) + (arr[n - 1] * divs[arr[i]][j]);
        ans = min(ans, temp);
      }
    }
  }
  cout << ans;
}
