#include <bits/stdc++.h>
using namespace std;
int nums[50000 + 10];
int n;
int main(void) {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", nums + i);
  }
  if (n == 1) {
    printf("%d", nums[0]);
    return 0;
  }
  sort(nums, nums + n);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum += nums[i];
  }
  long long ans = sum;
  for (int i = 1; i < n; i++) {
    for (int c = 1; c <= nums[i]; c++) {
      if (nums[i] % c) continue;
      long long tans = sum - nums[0] - nums[i] + (nums[0] * c) + (nums[i] / c);
      ans = min(ans, tans);
    }
  }
  cout << ans;
  return 0;
}
