#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
int division;
vector<int> calc(int n) {
  vector<int> ret;
  for (int q = 1; q * q <= n; q++) {
    if (q > division) ret.push_back(q);
    int r = n % q;
    ret.push_back((n - r) / q);
    if (!r) ret.push_back(n / q - 1);
  }
  sort(ret.begin(), ret.end());
  return ret;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = (0); i <= (n - 1); ++i) scanf("%d", &a[i]);
  int miv = *min_element(a.begin(), a.end());
  int k = sqrt(miv) + 1;
  division = k - 1;
  auto v = calc(a[0]);
  for (int i = (1); i <= (n - 1); ++i) {
    auto vv = calc(a[i]);
    v.erase(
        set_intersection(v.begin(), v.end(), vv.begin(), vv.end(), v.begin()),
        v.end());
  }
  if (!v.empty()) k = max(k, v.back() + 1);
  cerr << "k"
       << ": " << (k) << endl;
  ;
  LL ans = 0;
  for (int i = (0); i <= (n - 1); ++i) {
    if (a[i] % k == 0)
      ans += a[i] / k;
    else
      ans += a[i] / k + 1;
  }
  cout << ans << endl;
}
