#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 505;
const long long oo = 1LL << 50;
long long N, a[MAXN], sum = 0, ans = oo, tol = 0;
namespace solution {
void Prepare() {
  scanf("%lld", &N);
  for (long long i = 1; i <= N; i++) {
    scanf("%lld", &a[i]);
    sum += a[i];
    tol += a[i];
  }
  sum = sqrt(sum) + 1;
}
void Solve() {
  for (long long i = sum; i >= 1; i--) {
    long long tmp = 0;
    for (long long j = 1; j <= N; j++) {
      if (ceil(1.0 * a[j] / (i + 1)) * i <= a[j])
        tmp += ceil(1.0 * a[j] / (i + 1));
      else {
        tmp = oo;
        break;
      }
    }
    if (tmp < ans) {
      ans = tmp;
      break;
    }
  }
  for (long long i = 1; i <= sum; i++) {
    long long tmp = tol / i, mat = 0;
    if (tol % i == 0) tmp--;
    if (tmp <= 0) continue;
    bool OK = 1;
    for (long long j = 1; j <= N; j++)
      if (ceil(1.0 * a[j] / (tmp + 1)) * tmp > a[j]) {
        OK = 0;
        break;
      } else
        mat += ceil(1.0 * a[j] / (tmp + 1));
    if (OK && mat == i) {
      ans = min(ans, i);
      break;
    }
  }
  cout << ans << endl;
}
}  // namespace solution
int main() {
  using namespace solution;
  Prepare();
  Solve();
  return 0;
}
