#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, arr[50010];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  sort(arr, arr + n);
  int ans = (int)2e9;
  for (int x = 1; x <= 100; x++) {
    int idx = -1;
    for (int i = n - 1; i >= 0; i--) {
      if (arr[i] % x == 0) {
        idx = i;
        break;
      }
    }
    if (idx == -1) continue;
    int sum = 0;
    for (int i = 0; i < n; i++) {
      if (i == 0)
        sum += arr[i] * x;
      else if (i == idx)
        sum += arr[i] / x;
      else
        sum += arr[i];
    }
    ans = min(sum, ans);
  }
  printf("%d", ans);
  return 0;
}
