#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  std::vector<int> data;
  for (int i = 0; i < n; ++i) {
    int current;
    std::cin >> current;
    data.push_back(current);
  }
  std::sort(data.begin(), data.end());
  int minDelta = 0;
  for (int i = 1; i < n; ++i) {
    for (int d = 2; d <= data[i]; ++d) {
      if (data[i] % d) continue;
      int delta = data[0] * (d - 1) + data[i] / d - data[i];
      minDelta = std::min(delta, minDelta);
    }
  }
  int result = std::accumulate(data.begin(), data.end(), 0) + minDelta;
  std::cout << result << std::endl;
  return 0;
}
