#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const long long mod = 1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n;
int a[N];
long long foo(int mn, int mx) {
  long long res = 0;
  for (int i = 1; i <= n; i++) {
    int x = (a[i] + mx - 1) / mx;
    if (x * mx - a[i] > x) return 1e18;
    res += x;
  }
  return res;
}
void solve() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long ans = 1e18;
  for (int i = 1; i < N; i++) {
    if (i * i > a[1]) break;
    int x = a[1] / i;
    for (int it = -1; it <= 1; it++) {
      ans = min(ans, foo(x + it, x + it + 1));
    }
    ans = min(ans, foo(i, i + 1));
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  int T = 1;
  while (T--) {
    solve();
  }
}
