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