def main(): N = int(input()) R = list(map(int, input().split())) destination = N ctr = 1 while True: for idx, r in enumerate(R, 1): if r >= destination: destination = idx break if destination == 1: break ctr += 1 print(ctr) if __name__ == "__main__": main()