#include <bits/stdc++.h>
using namespace std;
int lim = 1e6;
int inf = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a[n];
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  int ans = sum;
  sort(a, a + n);
  for (int i = 1; i < n; i++) {
    int ans1 = inf;
    for (int j = 2; j <= a[i] / 2; j++) {
      if (a[i] % j == 0) {
        ans1 = min(ans1, sum - a[0] - a[i] + a[0] * j + a[i] / j);
      }
    }
    ans = min(ans, ans1);
  }
  cout << ans << '\n';
  ;
}
