#include <bits/stdc++.h>
using namespace std;
const int N = 5e4 + 2;
const int MOD = 1e9 + 7;
const int bm = 1;
int n, m, MIN = MOD;
int a[N];
void sinh() {
  freopen(".inp", "w", stdout);
  srand(time(0));
}
int main() {
  ios_base::sync_with_stdio(0);
  int dem = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i], dem += a[i];
  sort(a + 1, a + n + 1);
  MIN = dem;
  for (int i = 2; i <= n; i++)
    for (int j = 2; j <= sqrt(a[i]); j++)
      if (a[i] % j == 0)
        MIN = min(MIN, dem - a[1] - a[i] + a[1] * j + a[i] / j);
  cout << MIN;
}
