def next_player(num): current = 0 while True: yield current current+=1 current%=num N = int(input()) np = next_player(N) plays = map(int,[input() for x in range(N)]) k_score = 0 k_rank = 1 for play in plays: current = next(np) if current: if play > k_score: k_rank+=1 else: k_score = play print(k_rank)