#include <bits/stdc++.h>
using namespace std;
template <typename t>
t in(t q) {
  cin >> q;
  return q;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (int i = 0; i < ((int)size(v)); ++i) {
    os << v[i];
    if (i != ((int)size(v)) - 1) os << ",";
  }
  os << "]";
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const map<T, S>& v) {
  for (auto it : v) os << "(" << it.first << ":" << it.second << ")";
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const pair<T, S>& v) {
  os << "(" << v.first << "," << v.second << ")";
  return os;
}
const long double PI = acosl(-1);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng64(chrono::steady_clock::now().time_since_epoch().count());
inline int rand(int l, int r) {
  return uniform_int_distribution<int>(l, r)(rng);
}
inline long long rand(long long l, long long r) {
  return uniform_int_distribution<long long>(l, r)(rng);
}
long long a[(505)];
int n;
long long check(long long x) {
  long long ans = 0;
  for (auto i = 0; i < n; i++) {
    long long s = (a[i] + x) / (x + 1);
    if (x * s > a[i]) return (1100000000000000000);
    ans += s;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(10);
  cin >> n;
  for (auto i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long mi = (1100000000000000000);
  for (auto i = 1; i < min(100001ll, a[0] + 1); i++) {
    mi = min(mi, check(i));
  }
  long long t = a[0] / min(100001ll, a[0]);
  for (auto i = 1; i < t; i++) {
    if (a[0] % i) {
      mi = min(check(a[0] / i), mi);
    } else {
      mi = min({check(a[0] / i), mi, check(a[0] / i - 1)});
    }
  }
  cout << mi;
  return 0;
}
