#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n], a[101] = {0};
  int mn = 1e9 + 7;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
    mn = min(mn, arr[i]);
  }
  int ans = sum;
  for (int i = 0; i < n; i++) {
    for (int j = 1; j <= arr[i]; j++) {
      if (arr[i] % j == 0) {
        ans = min(ans, sum - (arr[i] - arr[i] / j) + mn * j - mn);
      }
    }
  }
  cout << ans;
  return 0;
}
