#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const int oo = 0x3f3f3f3f;
const int lim = 40000;
const int maxn = 510;
int n;
int a[maxn + 5];
long long ans = LLONG_MAX;
inline void work(int first) {
  if (!first) return;
  for (int i = (0), i_end_ = (n); i < i_end_; ++i)
    if (a[i] % first > a[i] / first) return;
  long long ret = 0;
  for (int i = (0), i_end_ = (n); i < i_end_; ++i)
    ret += (a[i] + first) / (first + 1);
  chkmin(ans, ret);
}
int main() {
  scanf("%d", &n);
  for (int i = (0), i_end_ = (n); i < i_end_; ++i) scanf("%d", a + i);
  for (int i = (1), i_end_ = (lim); i < i_end_; ++i) work(i);
  for (int i = (1), i_end_ = (lim); i < i_end_; ++i) {
    work(a[0] / i);
    if (!(a[0] % i)) work(a[0] / i - 1);
  }
  cout << ans << endl;
  return 0;
}
