#include <bits/stdc++.h>
using namespace std;
const int N = 5e2 + 5;
int n, a[N];
long long ask(int x) {
  long long ret = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i] % (x + 1) == 0) {
      ret += a[i] / (x + 1);
      continue;
    }
    int num = a[i] / (x + 1), y = a[i] % (x + 1);
    if (num + y < x) return -1;
    ret += num + 1;
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  long long ret = -1;
  for (int x = 1; x * x <= a[1]; ++x) {
    long long tmp = ask(x);
    if (tmp == -1) continue;
    if (ret == -1)
      ret = tmp;
    else
      ret = min(ret, tmp);
  }
  for (int k = 1; k * k <= a[1]; ++k) {
    int x = a[1] / k;
    long long tmp1 = ask(x);
    long long tmp2 = -1;
    if (x - 1 != 0) tmp2 = ask(x - 1);
    long long tmp;
    if (tmp1 == -1 && tmp2 == -1)
      tmp = -1;
    else if (tmp1 == -1 && tmp2 != -1)
      tmp = tmp2;
    else if (tmp1 != -1 && tmp2 == -1)
      tmp = tmp1;
    else
      tmp = min(tmp1, tmp2);
    if (tmp == -1) continue;
    if (ret == -1)
      ret = tmp;
    else
      ret = min(ret, tmp);
  }
  printf("%lld\n", ret);
  return 0;
}
