N = int(input()) lsR = list(map(lambda x:int(x)-1,input().split()))+[0] now = 0 nextto = lsR[0] cnt = 1 while True: if nextto == N-1: break ne = nextto for j in range(now,ne+1): nextto = max(nextto,lsR[j]) now = ne cnt += 1 print(cnt)