#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:167772160000")
using namespace std;
long long a[510];
int upTo[1000000];
map<long long, int> cntInt;
long long intervals[30000000];
int intCount;
inline void add(long long a, long long b) {
  if (a < 1000000)
    upTo[a] += b;
  else
    intervals[intCount++] = a * 4 - b + 2;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < (n); i++) cin >> a[i];
  for (int i = 0; i < (n); i++) {
    long long k;
    for (k = 1; k * k <= a[i]; k++) {
      long long lower = (a[i] - k) / k;
      if ((a[i] - k) % k) lower++;
      if (lower == 0) lower++;
      long long higher = a[i] / k;
      if (lower <= a[i] / (k + 1)) lower = a[i] / (k + 1) + 1;
      if (higher >= lower) {
        add(lower, 1);
        add(higher + 1, -1);
      }
    }
    if (a[i] / k >= 1) {
      cntInt[1]++;
      cntInt[a[i] / k + 1]--;
      add(1, 1);
      add((a[i] / k + 1), -1);
    }
  }
  long long truex;
  int sum = 0;
  sort(intervals, intervals + intCount);
  for (int i = 0; i < (1000000); i++) {
    if (sum == n) truex = i - 1;
    sum += upTo[i];
  }
  for (int i = 0; i < (intCount); i++) {
    if (sum == n && (i == 0 || intervals[i] / 4 != intervals[i - 1] / 4))
      truex = intervals[i] / 4 - 1;
    sum += 2 - (intervals[i] & 3);
  }
  long long answer = 0;
  truex++;
  for (int i = 0; i < (n); i++) {
    answer += a[i] / truex;
    if (a[i] % truex) answer++;
  }
  cout << answer << endl;
  return 0;
}
