#include <bits/stdc++.h>
using namespace std;
int n;
int a[555];
inline bool trial(int x, int y) {
  int block = y / x;
  int left = y % x;
  if (left <= block) return true;
  return false;
}
inline int calc(int x, int y) {
  int block = x / (y + 1);
  int left = x % (y + 1);
  if (block < ((y + 1) - left) % (y + 1)) return x / y;
  return block + (left > 0);
}
inline void gao(int a1, int a2, long long &res) {
  if (a1 == 0 || a2 == 0) return;
  long long cur = 0ll;
  for (int i = 0; i < n; i++) {
    if (a[i] < min(a1, a2)) return;
    if (trial(min(a1, a2), a[i]))
      cur += calc(a[i], min(a1, a2));
    else
      return;
  }
  res = min(res, cur);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  long long res = LLONG_MAX;
  for (int i = 1; i <= 31622; i++) {
    gao(i, i + 1, res);
    gao(i, i - 1, res);
    gao(a[0] / i, a[0] / i + 1, res);
    gao(a[0] / i, a[0] / i - 1, res);
  }
  cout << res;
  return 0;
}
