#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using int64 = long long int;
template <typename T>
void chmax(T &a, T b) {
  a = max(a, b);
}
template <typename T>
void chmin(T &a, T b) {
  a = min(a, b);
}
template <typename T>
void chadd(T &a, T b) {
  a = a + b;
}
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;
int main() {
  int N;
  scanf("%d", &N);
  vector<int> A(N);
  for (int i = 0; i < N; i++) scanf("%d", &A[i]);
  sort(A.begin(), A.end());
  ll ans = INF;
  {
    for (int x = 1; x * x <= A[0]; x++) {
      int d = A[0] / x, m = A[0] % x;
      for (int k = d; k >= d - (m == 0); k--) {
        int mi = k, ma = k + 1;
        ll sum = 0;
        for (int i = 0; i < N; i++) {
          ll b = (A[i] + ma - 1) / ma;
          if (mi * b <= A[i])
            sum += b;
          else
            sum = INF;
        }
        ans = min(ans, sum);
      }
    }
  }
  {
    for (int x = 1; x * x <= A[0]; x++) {
      int mi = x, ma = x + 1;
      ll sum = 0;
      for (int i = 0; i < N; i++) {
        ll b = (A[i] + ma - 1) / ma;
        if (mi * b <= A[i])
          sum += b;
        else
          sum = INF;
      }
      ans = min(ans, sum);
    }
  }
  cout << ans << endl;
  return 0;
}
