#include <bits/stdc++.h>
using namespace std;
bool prim(int n) {
  if (n < 2) return 0;
  if (n == 2) return 1;
  if (n % 2 == 0) return 0;
  for (int i = 3; i * i <= n; i += 2)
    if (n % i == 0) return 0;
  return 1;
}
int firstDiv(int n) {
  int d = 2;
  while (d * d <= n && n % d != 0) d++;
  return d;
}
int calcDiv(int n, int y, int d) {
  int mn = n + y;
  while (d * d <= n) {
    if (n % d == 0)
      if (n / d + y * d < mn) mn = n / d + y * d;
    d++;
  }
  return mn;
}
int a[50001];
int main() {
  int n, mn, d, s, smn;
  cin >> n;
  mn = 101;
  s = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] < mn) mn = a[i];
    s += a[i];
  }
  smn = s;
  for (int i = 1; i <= n; i++) {
    d = calcDiv(a[i], mn, 2);
    if (s - mn - a[i] + d < smn) smn = s - mn - a[i] + d;
  }
  cout << smn << endl;
  return 0;
}
