#include <bits/stdc++.h>
using namespace std;
const int N = 500200;
int k, m, n, a[N];
int main() {
  cin >> n;
  for (int i(0); i < n; i++) {
    cin >> a[i], m += a[i];
  }
  sort(a, a + n);
  a[n] = 1;
  k = m;
  for (int i(n - 1); i > 0; i--)
    if (a[i] != a[i + 1]) {
      for (int j = a[i]; j > 1; j--)
        if (a[i] % j == 0)
          if (m - a[i] - a[0] + a[i] / j + a[0] * j < k)
            k = m - a[i] - a[0] + a[i] / j + a[0] * j;
    }
  cout << k;
  return 0;
}
