#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000009;
int rd() {
  char c = getchar();
  int t = 0, f = 1;
  while (!isdigit(c)) f = (c == '-') ? -1 : 1, c = getchar();
  while (isdigit(c)) t = t * 10 + c - 48, c = getchar();
  return t * f;
}
void wt(int x) {
  if (x < 0)
    putchar('-'), wt(-x);
  else {
    if (x > 9) wt(x / 10);
    putchar(x % 10 + 48);
  }
}
int a[535], n;
long long ans;
long long calc(int x) {
  if (!x) return 1e18;
  long long ret = 0;
  for (int i = ((int)1); i <= ((int)n); i++)
    if (a[i] / x >= a[i] % x)
      ret += a[i] / (x + 1) + (a[i] % (x + 1) > 0);
    else
      return 1e18;
  return ret;
}
void ins(int n) {
  int l = 1, r;
  for (; l <= n; l = r + 1) {
    r = n / (n / l);
    ans = min(ans, calc(n / l));
    ans = min(ans, calc(n / l - 1));
  }
}
int main() {
  n = rd(), ans = 1e18;
  for (int i = ((int)1); i <= ((int)n); i++) a[i] = rd();
  ins(a[1]);
  printf("%I64d\n", ans);
  return 0;
}
