import heapq N = int(input()) H = sorted(list(map(int,input().split())),reverse=True) hmax = H[0] kmax = 0 while 1<1: mid = (high+low)//2 heap = [-H[i] for i in range(N)] for i in range(mid-1,-1,-1): if len(heap)==0:break h = -heapq.heappop(heap) h -= 1<0: heapq.heappush(heap,-h) if len(heap)==0: high = mid else: low = mid print(high)