#include <bits/stdc++.h>
using namespace std;
const int MAX = 110;
int sieve[MAX];
void build_sieve() {
  sieve[0] = sieve[1] = 1;
  for (int i = 2; i < MAX; ++i) {
    sieve[i] = i;
  }
  for (int i = 2; i < MAX; ++i) {
    if (sieve[i] == i) {
      for (int j = i + i; j < MAX; j += i) {
        sieve[j] = min(sieve[j], i);
      }
    }
  }
}
vector<int> factor(int x) {
  int VIS[MAX];
  memset(VIS, false, sizeof VIS);
  vector<int> ans;
  vector<int> tmp;
  while (x > 1) {
    ans.push_back(sieve[x]);
    if (!VIS[sieve[x]]) {
      tmp.push_back(sieve[x]);
      VIS[sieve[x]] = true;
    }
    x /= sieve[x];
  }
  int n = ans.size();
  for (int i = 0; i < (1 << n); ++i) {
    int p = 1;
    for (int j = 0; j < n; ++j) {
      if (i & (1 << j)) {
        p *= ans[j];
      }
    }
    if (!VIS[p]) {
      tmp.push_back(p);
      VIS[p] = true;
    }
  }
  return tmp;
}
int main() {
  build_sieve();
  int n, s = 0, m = INT_MAX, ans = 0;
  cin >> n;
  vector<int> array(n);
  for (int i = 0; i < n; ++i) {
    cin >> array[i];
    s += array[i];
    ans += array[i];
    m = min(m, array[i]);
  }
  for (int i = 0; i < n; ++i) {
    vector<int> tmp = factor(array[i]);
    for (int j = 0; j < tmp.size(); ++j) {
      int value = s - m - array[i] + (m * tmp[j]) + (array[i] / tmp[j]);
      ans = min(ans, value);
    }
  }
  cout << ans;
  return 0;
}
