#include <bits/stdc++.h>
using namespace std;
int a[200006];
long long cnt;
long long n;
int check(int x) {
  if (x <= 0) return 0;
  cnt = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] % x <= a[i] / x) {
      cnt += (a[i] + x) / (x + 1);
    } else
      return 0;
  }
  return 1;
}
int check2(int x) {
  if (x <= 1) return 0;
  cnt = 0;
  for (int i = 0; i < n; i++) {
    if (x - (a[i] % x) <= 1 || a[i] % x == 0) {
      cnt += (a[i] + x - 1) / (x);
    } else
      return 0;
  }
  return 1;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  int dot = sqrt((double)a[0]);
  vector<int> V;
  long long cnm = ((long long)1) << 60;
  for (int i = 1; i <= dot; i++) {
    if (check((a[0] / i))) cnm = min(cnm, cnt);
    if (check((a[0] / i) - 1)) cnm = min(cnm, cnt);
    if (cnm < ((long long)1) << 60) break;
  }
  for (int i = dot; i > 0; i--) {
    if (cnm < ((long long)1) << 60) break;
    if (check(i)) cnm = min(cnm, cnt);
    if (check(i - 1)) cnm = min(cnm, cnt);
  }
  cout << cnm << endl;
}
