#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimization("unroll-loops")
using namespace std;
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long overallSum = 0, minmSum = 0, n, i, j;
  cin >> n;
  long long a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    overallSum += a[i];
  }
  sort(a, a + n);
  minmSum = overallSum;
  for (i = n - 1; i >= 1; i--) {
    for (j = 2; j < a[i] + 1; j++) {
      if (a[i] % j == 0) {
        minmSum = min(minmSum, overallSum - a[i] - a[0] + a[i] / j + a[0] * j);
      }
    }
  }
  cout << minmSum;
  return 0;
}
