#include <bits/stdc++.h>
using namespace std;
template <class T>
using max_pq = priority_queue<T>;
template <class T>
using min_pq = priority_queue<T, vector<T>, greater<T>>;
int oo = 0x3f3f3f3f;
int n;
class BSashaAndMagneticMachines {
 public:
  void solve(istream& cin, ostream& cout) {
    cin >> n;
    int arr[n], sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      sum += arr[i];
    }
    sort(arr, arr + n);
    int ans = sum;
    for (int i = n - 1; i > 0; i--) {
      int j;
      for (j = 2; j <= sqrt(arr[i]); ++j) {
        if (arr[i] % j == 0) {
          int r = sum - arr[0] - arr[i] + arr[0] * j + arr[i] / j;
          ans = min(ans, r);
        }
      }
    }
    cout << ans;
  }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  BSashaAndMagneticMachines solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
