#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using ll = long long;
const char E = '\n';
const int N = 100005;
const ll mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ll n, ans = 0, a[N];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n);
  for (int i = 2; i <= n; i++) {
    a[i] -= ans;
    ll res = 0;
    res = (a[i] - a[i - 1]) * (i - 1);
    res = min(res, a[i]);
    ans += res;
    a[i] -= res;
  }
  ans +=
      ((a[n] % (n - 1) != 0) ? (a[n] % (n - 1) + 1) : (0)) + a[n] / (n - 1) * n;
  cout << ans;
  return 0;
}
