#include <bits/stdc++.h>
using std::cerr;
using std::make_tuple;
using std::pair;
using std::vector;
vector<long long> arr;
int main() {
  int n;
  scanf("%d", &n);
  long long m = 0;
  for (int i = 0; i < n; i++) {
    long long a;
    scanf("%lld", &a);
    arr.push_back(a);
    m = std::max(a, m);
  }
  long long left = m;
  long long right = 0x7ffffffffffffLL;
  long long ans = 0x7ffffffffffffLL;
  while (left <= right) {
    long long mid = (left + right) / 2;
    long long sum = 0;
    for (long long i : arr) {
      sum += (mid - i);
      if (sum >= mid) {
        break;
      }
    }
    if (sum >= mid) {
      ans = std::min(ans, mid);
      right = mid - 1;
    } else {
      left = mid + 1;
    }
  }
  printf("%lld", ans);
}
