#include <bits/stdc++.h>
using namespace std;
int N, A[510];
long long ans;
void Work(int x) {
  long long res = 0;
  bool flag = 1;
  for (int j = 1; j <= N; j++) {
    int a = A[j] / x;
    int b = A[j] % x;
    if (b && x - 1 - b > a) {
      flag = 0;
      break;
    }
    res += a;
    if (b > 0) res++;
  }
  if (flag) ans = min(ans, res);
}
int main() {
  scanf("%d", &N);
  ans = 0;
  for (int i = 1; i <= N; i++) {
    scanf("%d", &A[i]);
    ans += A[i];
  }
  for (int i = 2; i <= 32000; i++) {
    int x = i;
    Work(x);
  }
  for (int i = 1; i <= 32000; i++) {
    int x = A[1] / i;
    if (A[1] % i) x++;
    if (x <= 1) continue;
    Work(x);
    Work(x + 1);
  }
  cout << ans;
}
