#include <bits/stdc++.h>
using namespace std;
int arr[500002];
int main() {
  int a, b, c, d, e, i, j, k, sum = 0, mn, res;
  cin >> a;
  for (i = 1; i <= a; i++) {
    scanf("%d", &arr[i]);
    sum += arr[i];
  }
  mn = sum;
  res = sum;
  sort(arr + 1, arr + a + 1);
  for (i = 1; i <= a; i++) {
    if (i == 1) {
      for (j = 2; j <= arr[i]; j++) {
        if (arr[i] % j == 0) {
          res = sum;
          res = res - arr[i];
          res = res - arr[2];
          res = res + (arr[i] / j);
          res = res + (arr[2] * j);
          mn = min(mn, res);
        }
      }
    } else {
      for (j = 2; j <= arr[i]; j++) {
        if (arr[i] % j == 0) {
          res = sum;
          res = res - arr[i];
          res = res - arr[1];
          res = res + (arr[i] / j);
          res = res + (arr[1] * j);
          mn = min(mn, res);
        }
      }
    }
  }
  cout << mn;
  return 0;
}
