n = int(input()) a = list(map(int, input().split())) c = i = 0 while i < n - 1: if a[i] > a[i+1]: c += 1 i += 1 i += 1 print(n - c)