#include <bits/stdc++.h>
using namespace std;
int ada[101];
int a[500005];
int main() {
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
    ++ada[a[i]];
  }
  int msum = sum;
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= 100; j++) {
      for (int x = 2; x <= 100; x++)
        if (ada[i] && ada[j] && i > j && !(i % x))
          sum = min(sum, msum - (i + j) + (i / x) + j * x);
    }
  }
  cout << sum << endl;
  return 0;
}
