N = int(eval(input()))

Num = [int(i) for i in input().split()]



Max = Num[0]

Min = Num[0]

cnt  = 1

for i in range(1,N):

    if Num[i] <= Max and  Min>=Num[i] :

        cnt +=1

        

    Max = max(Max,Num[i])

    Min = min(Min,Num[i])

    #print(Max,Min)

print(cnt)

def main():

    n = int(eval(input()))

    p = [int(i) for i in input().split()]

    Min = [10**9]

    ans = 0

    for i in range(n):

        Min.append(min(Min[-1],p[i]))

    for i in range(n):

        if Min[i]>p[i]:

            ans += 1

    print(ans)

main()
N = int(eval(input()))
Num = [int(i) for i in input().split()]
Max = Num[0]
Min = Num[0]
cnt = 1
for i in range(1, N):
    if Num[i] <= Max and Min >= Num[i]:
        cnt += 1
    Max = max(Max, Num[i])
    Min = min(Min, Num[i])
    # print(Max,Min)
print(cnt)

def main():
    n = int(eval(input()))
    p = [int(i) for i in input().split()]
    Min = [10**9]
    ans = 0
    for i in range(n):
        Min.append(min(Min[-1], p[i]))
    for i in range(n):
        if Min[i] > p[i]:
            ans += 1
    print(ans)


main()

-N = int(eval(input())) -Num = [int(i) for i in input().split()] -Max = Num[0] -Min = Num[0] -cnt = 1 -for i in range(1, N): -    if Num[i] <= Max and Min >= Num[i]: -        cnt += 1 -    Max = max(Max, Num[i]) -    Min = min(Min, Num[i]) -    # print(Max,Min) -print(cnt) +def main(): +    n = int(eval(input())) +    p = [int(i) for i in input().split()] +    Min = [10**9] +    ans = 0 +    for i in range(n): +        Min.append(min(Min[-1], p[i])) +    for i in range(n): +        if Min[i] > p[i]: +            ans += 1 +    print(ans) + + +main()