n = int(input()) l = list(map(int, input().split())) x = l[0] y = 0 for i in range(1, n): if x > l[i]: y += 1 print(y)