#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a;
long long minimum = -1;
void tesztel(int csop) {
  if (csop <= 0) return;
  long long db = 0;
  for (int i = 0; i < a.size(); i++) {
    long long k = a[i] / csop;
    if ((a[i] % csop) > k) return;
    int x = 0;
    while (x != k && x + 1 != k) {
      int kozep = (x + k) / 2;
      if ((a[i] - kozep * csop) > kozep)
        x = kozep;
      else
        k = kozep;
    }
    db += k;
  }
  if (minimum > db || minimum == -1) minimum = db;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int ai;
    cin >> ai;
    a.push_back(ai);
  }
  sort(a.begin(), a.end());
  int tart = 1;
  while (minimum == -1) {
    int T = a[0] / tart;
    tesztel(T);
    tesztel(T - 1);
    tart++;
  }
  cout << minimum << endl;
}
