#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, M = 30;
const long long inf = 2e16;
int n, a[N];
long long check(long long x) {
  long long res = 0;
  for (int i = 1; i <= n; i++) {
    long long d = a[i] / x, r = a[i] % x;
    res += d;
    if (r) res++;
    if (r && d + r < x - 1) return inf;
  }
  return res;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  long long ans = inf;
  for (long long i = 1; i * i <= a[1]; i++) {
    ans = min(ans, check(i));
    long long k = i, x = (a[1] + k - 1) / k;
    ans = min(ans, check(x));
  }
  ans = min(ans, check(a[1] + 1));
  cout << ans << endl;
  return 0;
}
