#include <bits/stdc++.h>
using namespace std;
const int M = 5e4 + 5;
int a[M];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  if (n == 1) {
    printf("%d\n", a[0]);
    return 0;
  }
  sort(a, a + n);
  int sum = 0;
  for (int i = 0; i < n; i++) sum += a[i];
  int ans = sum;
  for (int i = 1; i < n; i++) {
    if (a[i] == a[i - 1]) continue;
    for (int j = 2; j * j <= a[i]; j++) {
      if (a[i] % j) continue;
      ans = min(ans, sum - a[0] + a[0] * j - a[i] + a[i] / j);
      ans = min(ans, sum - a[0] + a[0] * a[i] / j - a[i] + j);
    }
  }
  printf("%d\n", ans);
  return 0;
}
