#include <bits/stdc++.h>
using namespace std;
int a[1005];
int main() {
  int n, minn = 1234567890;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    minn = min(minn, a[i]);
  }
  vector<int> v;
  for (int i = 1; i * i <= minn; i++) {
    v.push_back(i);
    v.push_back(minn / i);
    if (minn % i == 0) {
      v.push_back(minn / i - 1);
    }
  }
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  reverse(v.begin(), v.end());
  long long ans = 505 * 1000000000LL;
  for (int x : v) {
    if (x == 0) break;
    long long sum = 0;
    bool ok = true;
    for (int i = 1; i <= n; i++) {
      int sts = (a[i] + x) / (x + 1);
      int ex = sts * (x + 1) - a[i];
      if (ex > sts) {
        ok = false;
        break;
      }
      sum += sts;
    }
    if (ok) ans = min(ans, sum);
  }
  cout << ans << endl;
  return 0;
}
