#include <bits/stdc++.h>
using namespace std;
long long a[505];
long long n;
long long get(long long x) {
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] % (x + 1) == 0) {
      ans += a[i] / (x + 1);
    } else {
      long long res = a[i] % (x + 1);
      long long m = a[i] / (x + 1);
      if (res + m < x) return (long long)1e18;
      ans += m + 1;
    }
  }
  return ans;
}
int main() {
  scanf("%I64d", &n);
  long long Min = 0x7fffffff;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    Min = min(Min, a[i]);
  }
  long long ans = 1e18;
  for (long long i = 1; i * i <= Min; i++) {
    ans = min(ans, get(i));
    ans = min(ans, get(Min / i));
    ans = min(ans, get(i - 1));
    ans = min(ans, get(Min / i - 1));
  }
  cout << ans << endl;
  return 0;
}
