#include <bits/stdc++.h>
using namespace std;
long long a[505];
long long n;
long long wellTry(long long x) {
  long long ret = 0;
  for (long long i = 0; i < n; i++) {
    long long cnt = (a[i] + x) / (x + 1);
    if (cnt * x <= a[i]) {
      ret += cnt;
    } else {
      return LLONG_MAX;
    }
  }
  return ret;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long minn = LLONG_MAX;
  for (long long x = 1; x * x <= a[0]; x++) {
    minn = min(minn, wellTry(x));
  }
  for (long long k = 1; k * k <= a[0]; k++) {
    minn = min(minn, wellTry(a[0] / k));
    minn = min(minn, wellTry(a[0] / k - 1));
  }
  cout << minn << '\n';
}
