n = int(input())
p = [int(i) for i in input().split()]
count = 0
for i in range(1,n):
    if i+1 == p[i]:
        cha = p[i-1]
        p[i-1] = p[i]
        p[i] = cha
        count+=1
if n == p[n-1]
    count+=1
print(count)