#include <bits/stdc++.h>
using namespace std;
int N, A[505];
bool chk(int x) {
  for (int i = 0; i < N; i++)
    if (A[i] / x < A[i] % x) return false;
  return true;
}
long long sol(int x) {
  long long ret = 0;
  for (int i = 0; i < N; i++) {
    ret += A[i] / (x + 1);
    if (A[i] % (x + 1)) ret++;
  }
  return ret;
}
vector<int> makeCandidates() {
  vector<int> cand;
  for (int i = 1; i < 40000; i++)
    if (A[0] % i <= A[0] / i) cand.push_back(i);
  for (int i = 1; i < 40000; i++) {
    int a = A[0] / i;
    if (0 < a && (A[0] % a <= A[0] / a)) cand.push_back(a);
    a--;
    if (0 < a && (A[0] % a <= A[0] / a)) cand.push_back(a);
  }
  sort(cand.begin(), cand.end());
  cand.erase(unique(cand.begin(), cand.end()), cand.end());
  return cand;
}
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) scanf("%d", &A[i]);
  sort(A, A + N);
  long long ans = 1LL << 60;
  for (int a : makeCandidates())
    if (chk(a)) ans = min(ans, sol(a));
  printf("%lld\n", ans);
}
