#include <bits/stdc++.h>
int a[50005];
int A(int a, int b) {
  if (a < b)
    return a;
  else
    return b;
}
int main() {
  int n;
  int i, j;
  scanf("%d", &n);
  int x = 0;
  int y = (1 << 30);
  int sum = 0;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] < y) {
      y = a[i];
    }
    sum += a[i];
  }
  x = sum;
  int z;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= a[i]; j++) {
      if (a[i] % j != 0) {
        continue;
      }
      z = sum - y - a[i];
      x = A(x, z + y * j + a[i] / j);
    }
  }
  printf("%d\n", x);
  return 0;
}
