#include <bits/stdc++.h>
using namespace std;
int n, m, c[100100], tail, a[100100];
long long ans = (long long)1e16;
inline int getint() {
  int w = 0, q = 0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') q = 1, c = getchar();
  while (c >= '0' && c <= '9') w = w * 10 + c - '0', c = getchar();
  return q ? -w : w;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) a[i] = getint();
  sort(a + 1, a + n + 1);
  int up = sqrt(a[1] + 0.5);
  for (int i = 1; i <= up; i++)
    if (a[1] / i >= a[1] % i) c[++tail] = i;
  for (int i = 1; i <= up; i++) {
    int k = a[1] / i;
    if (a[1] / k >= a[1] % k) c[++tail] = k;
    k--;
    if (!k) continue;
    if (a[1] / k >= a[1] % k) c[++tail] = k;
  }
  for (int i = 1; i <= tail; i++) {
    int k = c[i];
    bool pd = 1;
    for (int j = 1; j <= n; j++)
      if (a[j] / k < a[j] % k) pd = false;
    if (pd) {
      long long sum = 0;
      for (int j = 1; j <= n; j++)
        sum += a[j] / (k + 1) + (a[j] % (k + 1) != 0);
      ans = min(ans, sum);
    }
  }
  cout << ans;
  return 0;
}
