There are n boxes with colored balls on the table. Colors are numbered from 1 to n. i-th box contains ai balls, all of which have color i. You have to write a program that will divide all balls into sets such that:

  * each ball belongs to exactly one of the sets, 
  * there are no empty sets, 
  * there is no set containing two (or more) balls of different colors (each set contains only balls of one color), 
  * there are no two sets such that the difference between their sizes is greater than 1. 



Print the minimum possible number of sets.

Input

The first line contains one integer number n (1 ≤ n ≤ 500).

The second line contains n integer numbers a1, a2, ... , an (1 ≤ ai ≤ 109).

Output

Print one integer number — the minimum possible number of sets.

Examples

Input

3
4 7 8


Output

5


Input

2
2 7


Output

4

Note

In the first example the balls can be divided into sets like that: one set with 4 balls of the first color, two sets with 3 and 4 balls, respectively, of the second color, and two sets with 4 balls of the third color.
#include <bits/stdc++.h>
using namespace std;
long long dx[8] = {0, 1, 0, -1, 1, 1, -1, -1};
long long dy[8] = {1, 0, -1, 0, -1, 1, 1, -1};
class pa3 {
 public:
  long long x;
  long long y, z;
  pa3(long long x = 0, long long y = 0, long long z = 0) : x(x), y(y), z(z) {}
  bool operator<(const pa3 &p) const {
    if (x != p.x) return x < p.x;
    if (y != p.y) return y < p.y;
    return z < p.z;
  }
  bool operator>(const pa3 &p) const {
    if (x != p.x) return x > p.x;
    if (y != p.y) return y > p.y;
    return z > p.z;
  }
  bool operator==(const pa3 &p) const {
    return x == p.x && y == p.y && z == p.z;
  }
  bool operator!=(const pa3 &p) const {
    return !(x == p.x && y == p.y && z == p.z);
  }
};
class pa4 {
 public:
  long long x;
  long long y, z, w;
  pa4(long long x = 0, long long y = 0, long long z = 0, long long w = 0)
      : x(x), y(y), z(z), w(w) {}
  bool operator<(const pa4 &p) const {
    if (x != p.x) return x < p.x;
    if (y != p.y) return y < p.y;
    if (z != p.z) return z < p.z;
    return w < p.w;
  }
  bool operator>(const pa4 &p) const {
    if (x != p.x) return x > p.x;
    if (y != p.y) return y > p.y;
    if (z != p.z) return z > p.z;
    return w > p.w;
  }
  bool operator==(const pa4 &p) const {
    return x == p.x && y == p.y && z == p.z && w == p.w;
  }
};
class pa2 {
 public:
  long long x, y;
  pa2(long long x = 0, long long y = 0) : x(x), y(y) {}
  pa2 operator+(pa2 p) { return pa2(x + p.x, y + p.y); }
  pa2 operator-(pa2 p) { return pa2(x - p.x, y - p.y); }
  bool operator<(const pa2 &p) const { return y != p.y ? y < p.y : x < p.x; }
  bool operator>(const pa2 &p) const { return x != p.x ? x < p.x : y < p.y; }
  bool operator==(const pa2 &p) const {
    return abs(x - p.x) == 0 && abs(y - p.y) == 0;
  }
  bool operator!=(const pa2 &p) const {
    return !(abs(x - p.x) == 0 && abs(y - p.y) == 0);
  }
};
string itos(long long i) {
  ostringstream s;
  s << i;
  return s.str();
}
long long Gcd(long long v, long long b) {
  if (v == 0) return b;
  if (b == 0) return v;
  if (v > b) return Gcd(b, v);
  if (v == b) return b;
  if (b % v == 0) return v;
  return Gcd(v, b % v);
}
long long mod;
long long extgcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long d = extgcd(b, a % b, y, x);
  y -= a / b * x;
  return d;
}
pair<long long, long long> operator+(const pair<long long, long long> &l,
                                     const pair<long long, long long> &r) {
  return {l.first + r.first, l.second + r.second};
}
pair<long long, long long> operator-(const pair<long long, long long> &l,
                                     const pair<long long, long long> &r) {
  return {l.first - r.first, l.second - r.second};
}
ostream &operator<<(ostream &os, const vector<long long> &VEC) {
  for (auto v : VEC) os << v << " ";
  return os;
}
ostream &operator<<(ostream &os, const pair<long long, long long> &PAI) {
  os << PAI.first << " : " << PAI.second;
  return os;
}
ostream &operator<<(ostream &os, const pa3 &PAI) {
  os << PAI.x << " : " << PAI.y << " : " << PAI.z;
  return os;
}
ostream &operator<<(ostream &os, const pa4 &PAI) {
  os << PAI.x << " : " << PAI.y << " : " << PAI.z << " : " << PAI.w;
  return os;
}
long long beki(long long wa, long long rr, long long warukazu) {
  if (rr == 0) return 1 % warukazu;
  if (rr == 1) return wa % warukazu;
  wa %= warukazu;
  if (rr % 2 == 1)
    return ((long long)beki(wa, rr - 1, warukazu) * (long long)wa) % warukazu;
  long long zx = beki(wa, rr / 2, warukazu);
  return (zx * zx) % warukazu;
}
long long pr[1100000];
long long inv[1100000];
long long comb(long long nn, long long rr) {
  if (rr < 0 || rr > nn || nn < 0) return 0;
  long long r = pr[nn] * inv[rr];
  r %= mod;
  r *= inv[nn - rr];
  r %= mod;
  return r;
}
void gya(long long ert) {
  pr[0] = 1;
  for (long long i = 1; i <= ert; i++) {
    pr[i] = ((long long)pr[i - 1] * i) % mod;
  }
  inv[ert] = beki(pr[ert], mod - 2, mod);
  for (long long i = ert - 1; i >= 0; i--) {
    inv[i] = (long long)inv[i + 1] * (i + 1) % mod;
  }
}
struct unionfind {
 private:
 public:
  vector<long long> par, ranks, kosuu;
  void shoki(long long N) {
    par.resize(N + 1, 0);
    ranks.resize(N + 1, 0);
    kosuu.resize(N + 1, 1);
    for (long long i = 0; i <= N; i++) {
      par[i] = i;
    }
  }
  long long root(long long x) {
    return par[x] == x ? x : par[x] = root(par[x]);
  }
  bool same(long long x, long long y) { return root(x) == root(y); }
  bool is_root(long long x) { return x == root(x); }
  void unite(long long x, long long y) {
    x = root(x);
    y = root(y);
    long long xx = kosuu[x], yy = kosuu[y];
    if (x == y) return;
    if (ranks[x] < ranks[y]) {
      par[x] = y;
      kosuu[y] = yy + xx;
    } else {
      par[y] = x;
      if (ranks[x] == ranks[y]) ranks[x] = ranks[x] + 1;
      kosuu[x] = yy + xx;
    }
    return;
  }
};
long long ch(long long a, long long b, long long d) {
  if (a < 0 || b < 0) return 1;
  if (a + b == 0) {
    if (d == 0)
      return 1;
    else
      return 0;
  }
  if (a == 0 && b == 1) {
    if (d == 0) return 0;
    return 1;
  }
  if (a == 1 && b == 0) {
    if (d == 1) return 0;
    return 1;
  }
  if (a) {
    if (ch(a - 2, b, d) == 1 && ch(a - 1, b - 1, d) == 1) return 1;
  }
  if (b) {
    if (ch(a - 1, b - 1, d ^ 1) == 1 && ch(a, b - 2, d ^ 1) == 1) return 1;
  }
  return 0;
}
long long ch2(long long a, long long b, long long g) {
  if (g == 1) {
    if (a % 2) {
      if (b % 4 == 0) return 0;
      return 1;
    } else {
      if (b % 4 == 0 || b % 4 == 3) return 0;
      return 1;
    }
  }
  if (g == 0) {
    if (a % 2) {
      if (b % 4 == 2) return 0;
      return 1;
    } else {
      if (b % 4 == 2 || b % 4 == 1) return 0;
      return 1;
    }
  }
}
void solve() {
  long long n;
  set<long long> se;
  cin >> n;
  long long a;
  vector<long long> w;
  cin >> a;
  w.push_back(a);
  long long it = 1;
  vector<pair<long long, long long> > tan;
  while (1) {
    if (it > a) break;
    long long g;
    if (a % it == 0) {
      g = a / it;
      se.insert(g);
      se.insert(g - 1);
      it++;
      continue;
    }
    g = a / it;
    se.insert(g);
    long long ue = a / g;
    if (a % g == 0) ue--;
    it = ue + 1;
  }
  vector<pair<long long, long long> > ve;
  for (auto v : se) {
    ve.push_back(make_pair(v, 1));
  }
  for (long long er = 1; er < n; er++) {
    cin >> a;
    w.push_back(a);
    for (auto &v : ve)
      if (v.second)
        if (v.first > 0) {
          long long x = v.first;
          if (a / x < a / (x + 1) + !!(a % (x + 1))) {
            v.second = 0;
          }
        }
  }
  long long gg = 1;
  for (auto v : ve)
    if (v.second) {
      gg = v.first + 1;
    }
  long long ans = 0;
  for (auto v : w) ans += v / gg + !!(v % gg);
  cout << ans << endl;
}
signed main() {
  mod = 1000000007;
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n = 1;
  for (long long i = 0; i < n; i++) solve();
  return 0;
}
