#include <bits/stdc++.h>
using namespace std;
int n, v, buck[200], arr[1000], men = 1000, mini = 1000, sum, sum2, x;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    sum += x;
    buck[x]++;
    if (x < men) men = x;
  }
  for (int i = 1; i <= 100; i++) {
    if (buck[i] > 0) arr[v++] = i;
  }
  mini = sum;
  for (int i = 1; i <= 100 and i <= arr[v - 1]; i++) {
    for (int j = v - 1; j >= 0; j--) {
      if (arr[j] % i == 0) {
        sum2 = sum;
        sum2 -= men;
        sum2 -= arr[j];
        sum2 += (men * i) + (arr[j] / i);
        mini = min(sum2, mini);
        break;
      }
    }
  }
  printf("%d", mini);
  return 0;
}
