One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number of rounds of the "Mafia" game they need to play to let each person play at least as many rounds as they want?

Input

The first line contains integer n (3 ≤ n ≤ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109) — the i-th number in the list is the number of rounds the i-th person wants to play.

Output

In a single line print a single integer — the minimum number of game rounds the friends need to let the i-th person play at least ai rounds.

Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.

Examples

Input

3
3 2 2


Output

4


Input

4
2 2 2 2


Output

3

Note

You don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
#include <bits/stdc++.h>
using namespace std;
#pragma pack(4)
const double pi = acos(-1.0);
const int inf = 0x7f7f7f7f;
const long long INF = 0x7f7f7f7f7f7f7f7fll;
const int go[8][2] = {{0, 1}, {0, -1}, {1, 0},  {-1, 0},
                      {1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
inline bool RD(int& a) { return scanf("%d", &a) != EOF; }
inline bool RD(char& a) { return scanf("%c", &a) != EOF; }
inline bool RD(char* a) { return scanf("%s", a) != EOF; }
inline bool RD(double& a) { return scanf("%lf", &a) != EOF; }
inline bool RD(long long& a) { return scanf("%I64d", &a) != EOF; }
template <class T1>
inline bool IN(T1& a) {
  return RD(a);
}
template <class T1, class T2>
inline bool IN(T1& a, T2& b) {
  return RD(a) && RD(b);
}
template <class T1, class T2, class T3>
inline bool IN(T1& a, T2& b, T3& c) {
  return RD(a) && RD(b) && RD(c);
}
template <class T1, class T2, class T3, class T4>
inline bool IN(T1& a, T2& b, T3& c, T4& d) {
  return RD(a) && RD(b) && RD(c) && RD(d);
}
template <class T1, class T2, class T3, class T4, class T5>
inline bool IN(T1& a, T2& b, T3& c, T4& d, T5& e) {
  return RD(a) && RD(b) && RD(c) && RD(d) && RD(e);
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
inline bool IN(T1& a, T2& b, T3& c, T4& d, T5& e, T6& f) {
  return RD(a) && RD(b) && RD(c) && RD(d) && RD(e) && RD(f);
}
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7>
inline bool IN(T1& a, T2& b, T3& c, T4& d, T5& e, T6& f, T7& g) {
  return RD(a) && RD(b) && RD(c) && RD(d) && RD(e) && RD(f) && RD(g);
}
inline void PT(int a) { printf("%d", a); }
inline void PT(char a) { printf("%c", a); }
inline void PT(char* a) { printf("%s", a); }
inline void PT(double a) { printf("%f", a); }
inline void PT(long long a) { printf("%I64d", a); }
inline void PT(const char a[]) { printf("%s", a); }
template <class T1>
inline void OT(T1 a) {
  PT(a);
}
template <class T1, class T2>
inline void OT(T1 a, T2 b) {
  PT(a), PT(' '), PT(b);
}
template <class T1, class T2, class T3>
inline void OT(T1 a, T2 b, T3 c) {
  PT(a), PT(' '), PT(b), PT(' '), PT(c);
}
template <class T1, class T2, class T3, class T4>
inline void OT(T1 a, T2 b, T3 c, T4 d) {
  PT(a), PT(' '), PT(b), PT(' '), PT(c), PT(' '), PT(d);
}
template <class T1, class T2, class T3, class T4, class T5>
inline void OT(T1 a, T2 b, T3 c, T4 d, T5 e) {
  PT(a), PT(' '), PT(b), PT(' '), PT(c), PT(' '), PT(d), PT(' '), PT(e);
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
inline void OT(T1 a, T2 b, T3 c, T4 d, T5 e, T6 f) {
  PT(a), PT(' '), PT(b), PT(' '), PT(c), PT(' '), PT(d), PT(' '), PT(e),
      PT(' '), PT(f);
}
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7>
inline void OT(T1 a, T2 b, T3 c, T4 d, T5 e, T6 f, T7 g) {
  PT(a), PT(' '), PT(b), PT(' '), PT(c), PT(' '), PT(d), PT(' '), PT(e),
      PT(' '), PT(f), PT(' '), PT(g);
}
template <class T1>
inline void OL(T1 a) {
  PT(a), PT('\n');
}
template <class T1, class T2>
inline void OL(T1 a, T2 b) {
  PT(a), PT(' '), PT(b), PT('\n');
}
template <class T1, class T2, class T3>
inline void OL(T1 a, T2 b, T3 c) {
  PT(a), PT(' '), PT(b), PT(' '), PT(c), PT('\n');
}
template <class T1, class T2, class T3, class T4>
inline void OL(T1 a, T2 b, T3 c, T4 d) {
  PT(a), PT(' '), PT(b), PT(' '), PT(c), PT(' '), PT(d), PT('\n');
}
template <class T1, class T2, class T3, class T4, class T5>
inline void OL(T1 a, T2 b, T3 c, T4 d, T5 e) {
  PT(a), PT(' '), PT(b), PT(' '), PT(c), PT(' '), PT(d), PT(' '), PT(e),
      PT('\n');
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
inline void OL(T1 a, T2 b, T3 c, T4 d, T5 e, T6 f) {
  PT(a), PT(' '), PT(b), PT(' '), PT(c), PT(' '), PT(d), PT(' '), PT(e),
      PT(' '), PT(f), PT('\n');
}
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7>
inline void OL(T1 a, T2 b, T3 c, T4 d, T5 e, T6 f, T7 g) {
  PT(a), PT(' '), PT(b), PT(' '), PT(c), PT(' '), PT(d), PT(' '), PT(e),
      PT(' '), PT(f), PT(' '), PT(g), PT('\n');
}
template <class T>
inline T lb(T i) {
  return i & -i;
}
template <class T>
inline T lc(T i) {
  return i << 1;
}
template <class T>
inline T rc(T i) {
  return i << 1 | 1;
}
template <class T>
inline T at(T a, int i) {
  return a & (T(1) << i);
}
template <class T>
inline T nt(T a, int i) {
  return a ^ (T(1) << i);
}
template <class T>
inline T s1(T a, int i) {
  return a | (T(1) << i);
}
template <class T>
inline T s0(T a, int i) {
  return a & ~(T(1) << i);
}
const double eps = 1e-8;
inline int cmp(double a, double b = 0) {
  return fabs(a - b) < eps ? 0 : ((a - b) > eps ? +1 : -1);
}
inline double fmax(double a, double b) { return cmp(a, b) > 0 ? a : b; }
inline double fmin(double a, double b) { return cmp(a, b) < 0 ? a : b; }
long long n, a;
int main() {
  while (IN(n)) {
    long long sum = 0, up = 0;
    for (int i = int(0), _i = int(n - 1); i <= _i; i++) {
      IN(a);
      sum += a;
      if (a > up) up = a;
    }
    long long ans = (sum + n - 2) / (n - 1);
    if (ans < up)
      OL(up);
    else
      OL(ans);
  }
  return 0;
}
