#include <bits/stdc++.h>
using namespace std;
vector<long long> d[105];
void pre() {
  for (long long i = 1; i <= 100; i++)
    for (long long j = 1; j <= i; j++)
      if (i % j == 0) d[i].push_back(j);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  pre();
  int n;
  cin >> n;
  long long ara[n], sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> ara[i];
    sum += ara[i];
  }
  sort(ara, ara + n);
  long long res = sum;
  for (int i = n - 1; i > 0; i--) {
    for (auto x : d[ara[i]]) {
      long long temp = sum - ara[0] - ara[i] + (ara[i] / x) + (ara[0] * x);
      res = min(res, temp);
    }
  }
  cout << res << endl;
  return 0;
}
