#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, x;
  cin >> n;
  int arr[n];
  int mini = 100000, sum = 0, maxi = -1;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    sum = sum + arr[i];
    if (arr[i] < mini) {
      mini = arr[i];
    }
    if (arr[i] > maxi) {
      maxi = arr[i];
    }
  }
  int min_sum = sum;
  for (x = 1; x <= maxi; x++) {
    for (i = 0; i < n; i++) {
      int new_sum = sum;
      if (arr[i] % x == 0) {
        new_sum = sum - mini - arr[i] + (mini * x) + (arr[i] / x);
      }
      if (new_sum < min_sum) {
        min_sum = new_sum;
      }
    }
  }
  cout << min_sum << endl;
}
