#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-8;
int n;
int a[505];
bool check(int k, int v, int* s) {
  int min_ab = v / (k + 1);
  int max_ab = v / k;
  if (v - max_ab * k > max_ab) {
    return 0;
  }
  for (int i = min_ab; i <= max_ab; ++i) {
    if (v - i * k <= i) {
      *s = i;
      return 1;
    }
  }
  return 1;
}
bool checks(int k, long long int* s) {
  *s = 0;
  int p = 0;
  for (int i = 0; i < n; ++i) {
    if (!check(k, a[i], &p)) return 0;
    *s += p;
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  while (cin >> n) {
    long long int res = 0, tmp = 0;
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
      res += a[i];
    }
    sort(a, a + n);
    int sq = sqrt(a[0]);
    for (int i = 1; i <= sq + 2; ++i) {
      if (checks(i, &tmp)) {
        res = min(res, tmp);
      }
    }
    for (int i = 1; i <= sq + 2; ++i) {
      int k = a[0] / i;
      if (k <= sq + 2) {
        continue;
      }
      if (checks(k, &tmp)) {
        res = min(res, tmp);
      }
      if (k > 1 && checks(k - 1, &tmp)) {
        res = min(res, tmp);
      }
    }
    cout << res << "\n";
  }
  return 0;
}
