#include <bits/stdc++.h>
using namespace std;
int n;
long long ans = 0x3f3f3f3f3f3f, a[510];
void calc(long long val) {
  if (!val) return;
  long long res = 0;
  for (int i = 1; i <= n; i++) {
    long long p = a[i] / val, q = a[i] % val;
    if (p < q) return;
    res += p - (p - q) / (val + 1);
  }
  ans = min(ans, res);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  sort(a + 1, a + 1 + n);
  for (long long i = 1; i * i <= a[1]; i++)
    calc(i), calc(a[1] / i), calc(a[1] / i - 1);
  printf("%lld\n", ans);
  return 0;
}
