#include <bits/stdc++.h>
using namespace std;
const int N = 555;
int n, a[N];
bool check(int64_t x, int64_t &bx) {
  int64_t z = 0;
  for (int j = 0; j < n; ++j) {
    int64_t k = (a[j] + x - 1) / x;
    int A = a[j] - k * (x - 1);
    int B = k * x - a[j];
    if (A < 0 || B < 0) return false;
    z += A + B;
  }
  if (bx < 0) bx = z;
  return x >= 1 && z <= bx;
}
int main() {
  scanf("%d", &n);
  int64_t s = 0;
  for (int i = 0; i < n; ++i) scanf("%d", a + i), s += a[i];
  sort(a, a + n);
  int64_t x = s, bx = 1;
  while (bx <= s) {
    x = (s + bx - 1) / bx;
    if (x < 40000) break;
    if (check(x, bx)) {
      cout << bx << endl;
      return 0;
    }
    ++bx;
  }
  while (x >= 1) {
    bx = -1;
    if (check(x, bx)) {
      cout << bx << endl;
      return 0;
    }
    --x;
  }
  return 0;
}
