#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int &i : a) cin >> i;
  long long inf = 1e15, T = inf, t;
  int b0 = a[0], q, r, i;
  for (i = 1; i * i <= b0; i++) {
    int b[] = {i, i + 1, b0 / i, b0 / i + 1};
    for (int bi : b) {
      t = 0;
      for (int ai : a) {
        q = (ai + bi - 1) / bi, r = ai % bi;
        t += (!r || q >= bi - r ? q : inf);
      }
      T = min(T, t);
    }
  }
  cout << T << endl;
}
