#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; vector H(N); for(auto &h : H) cin >> h; sort(H.rbegin(),H.rend()); long long low = 0,high = N+100; while(high-low > 1){ long long mid = (high+low)/2; long long x = mid-1; priority_queue Q; for(auto h : H){ if(x < 60) Q.push(h); else x--; } while(Q.size()){ if(x == -1){x--; break;} long long h = Q.top(); Q.pop(); h -= 1LL< 0) Q.push(h); } if(x == -2) low = mid; else high = mid; } cout << high << endl; }