#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  unordered_map<int, int> m;
  for (int i = 0; i < n; i++) {
    int k;
    cin >> k;
    m[k]++;
  }
  long long sum = 0;
  for (auto p : m) sum += p.first * p.second;
  long long maxi = sum;
  for (int x = 1; x <= 100; x++) {
    for (int i = 1; i <= 100; i++) {
      if (x > i) continue;
      for (int j = 1; j <= 100; j++) {
        if (m.count(i) > 0 && m.count(j) > 0) {
          if (i == j && m[i] == 1) continue;
          if (i % x != 0) continue;
          long long temp = sum - i + (i / x) - j + (j * x);
          if (temp < maxi) maxi = temp;
        }
      }
    }
  }
  cout << maxi << endl;
}
