#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 500 + 21, inf = 1e14 + 21;
int n;
long long q, r;
long long a[MAXN];
long long ans = inf;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int x = a[0];
  for (int i = 1; i * i <= x; i++) {
    int b[] = {i, i + 1, x / i, (x / i) + 1};
    for (int j = 0; j < 4; j++) {
      long long tmp = 0;
      for (int k = 0; k < n; k++) {
        q = (a[k] + b[j] - 1) / b[j];
        r = a[k] % b[j];
        tmp += (!r || q >= b[j] - r ? q : inf);
      }
      ans = min(ans, tmp);
    }
  }
  cout << ans;
  return 0;
}
