Buggy python submission (verdict: Time Limit Exceeded):
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():

    N=int(input())
    P=list(map(int,input().split()))
    A=[]
    for i in range(N):
        A.append(min(P[:i+1]))
    print(len(set(A)))

resolve()

Fixed submission:
def resolve():

    N=int(input())
    P=list(map(int,input().split()))
    pmin=P[0]
    cnt=0
    for i in range(N):
        if P[i]<=pmin:
            cnt+=1
            pmin=P[i]
    print(cnt)

resolve()

Buggy python submission (verdict: Time Limit Exceeded):
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():

    N=int(input())
    P=list(map(int,input().split()))

    cnt=0
    for i in range(N):
        if P[i]==min(P[:i+1]):
            cnt+=1
    print(cnt)

resolve()

Fixed submission:
def resolve():

    N=int(input())
    P=list(map(int,input().split()))
    pmin=P[0]
    cnt=0
    for i in range(N):
        if P[i]<=pmin:
            cnt+=1
            pmin=P[i]
    print(cnt)

resolve()

Buggy python submission (verdict: Time Limit Exceeded):
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():

    N=int(input())
    P=list(map(int,input().split()))

    cnt=0
    for i in range(N):
        if P[i]==min(P[:i+1]):
            cnt+=1
    print(cnt)

resolve()

Fixed submission:
def resolve():

    N=int(input())
    P=list(map(int,input().split()))
    pmin=P[0]
    cnt=0
    for i in range(N):
        if P[i]<=pmin:
            cnt+=1
            pmin=P[i]
    print(cnt)

resolve()

Buggy python submission (verdict: Time Limit Exceeded):
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    N=int(input())
    P=list(map(int,input().split()))

    cnt=0
    for i in range(N):
        if all(j >=P[i] for j in P[:i]):
            cnt+=1
    print(cnt)


resolve()

Fixed submission:
def resolve():

    N=int(input())
    P=list(map(int,input().split()))
    pmin=P[0]
    cnt=0
    for i in range(N):
        if P[i]<=pmin:
            cnt+=1
            pmin=P[i]
    print(cnt)

resolve()

Buggy python submission (verdict: Time Limit Exceeded):
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    N=int(input())
    P=list(map(int,input().split()))

    cnt=0
    for i in range(N):
        if all(j >=P[i] for j in P[:i]):
            cnt+=1
    print(cnt)


resolve()

Fixed submission:
def resolve():

    N=int(input())
    P=list(map(int,input().split()))
    pmin=P[0]
    cnt=0
    for i in range(N):
        if P[i]<=pmin:
            cnt+=1
            pmin=P[i]
    print(cnt)

resolve()