import heapq N = int(input()) heap = sorted(list(map(int,input().split()))) M = len(heap) hmax = heap[-1] kmax = 0 while 1<>i & 1: h -= 1<0: heapq.heappush(heap1,h) M1 += 1 break if h%(1<0: h -= 1<0: heapq.heappush(heap1,h) M1 += 1 break heapq.heappush(heap1,h) M1 += 1 heap += heap1 M += M1 heap = sorted(heap) if M==0: print(cnt) else: print(cnt+M)