#include <bits/stdc++.h>
const int lim = 1e6;
int n, arr[lim], cubeta[100], salida[100], pos;
int total, pivote;
void acomodo() {
  for (int i = 0; i <= 100; i++) {
    if (cubeta[i] == 1) {
      salida[pos++] = i;
    }
  }
}
void creador(int num1, int num2) {
  for (int i = 1; i <= 100; i++) {
    if (num1 % i == 0) {
      int temp = num1 / i;
      int temp2 = num2 * i;
      int aux = (pivote) - (num1 + num2) + (temp + temp2);
      total = (total < aux) ? total : aux;
    }
    if (num2 % i == 0) {
      int temp = num1 * i;
      int temp2 = num2 / i;
      int aux = (pivote) - (num1 + num2) + (temp + temp2);
      total = (total < aux) ? total : aux;
    }
  }
}
void minimo() {
  for (int i = 0; i < pos; i++) {
    for (int j = i + 1; j < pos; j++) {
      creador(salida[i], salida[j]);
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int aux;
    scanf("%d", &aux);
    cubeta[aux] = 1;
    total += aux;
  }
  pivote = total;
  acomodo();
  minimo();
  printf("%d\n", total);
  return 0;
}
