n = int(input()) a = list(map(int, input().split())) n = n k = -1 count = 0 for i in range(n): if a[i] > k: k = a[i] count += 1 print(n - count)