#include <bits/stdc++.h>
using namespace std;
inline void prep() {
  cin.tie(0);
  cin.sync_with_stdio(0);
};
long long mod = 998244353;
long long mymod(long long num) {
  if (num < 0 && !(num % mod == 0)) {
    if (mod == 1) {
      return 0;
    }
    return mod - abs(num) % mod;
  } else {
    return num % mod;
  }
}
const int biggg = 1000000001;
const long long bigggest = 1000000000000000000LL;
const double eps = .0000000001;
int arr[500];
int n;
long long func(int one) {
  if (one == 0 || one == -1) return 0;
  long long groups = 0;
  bool good = true;
  for (int i = 0; i < n && good; i++) {
    int many = ((one + 1) - arr[i] % (one + 1)) % (one + 1);
    groups += many;
    int temp = arr[i] - many * one;
    if (temp % (one + 1) == 0 && temp >= 0)
      groups += temp / (one + 1);
    else if (arr[i] % one == 0)
      groups += arr[i] / one;
    else
      good = false;
  }
  if (!good) return 0;
  return groups;
}
int main() {
  prep();
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  int minnest = *min_element(arr, arr + n);
  long long realres = bigggest;
  vector<int> facts;
  for (int i = 1; i <= sqrt(minnest); i++) facts.push_back(i);
  int tempsze = facts.size();
  for (int i = tempsze - 1; i >= 1; i--)
    if (minnest % facts[i] == 0) facts.push_back(minnest / i + 1);
  long long res;
  for (int i : facts) {
    res = func(minnest / i);
    if (res != 0) {
      cout << res;
      return 0;
    }
    res = func(minnest / i - 1);
    if (res != 0) {
      cout << res;
      return 0;
    }
  }
  return 0;
}
