#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int arr[n];
  for (int a = 0; a < n; a++) cin >> arr[a];
  sort(arr, arr + n);
  long long int x, y, z, ans = 0, ans1 = 0;
  for (int a = 0; a < n; a++) ans += arr[a];
  ans1 = ans;
  for (int a = 1; a < n; a++) {
    y = arr[a];
    for (int aa = 1; aa <= y; aa++) {
      if (y % aa == 0) {
        ans1 = min(ans1, ans - arr[0] - y + (arr[0] * aa) + (y / aa));
      }
    }
  }
  cout << ans1;
  return 0;
}
