# ABC 152 C

si = lambda: eval(input())

ni = lambda: int(eval(input()))

nm = lambda: list(map(int, input().split()))

snm = lambda: list(map(str, input().split()))

nl = lambda: list(map(int, input().split()))

n=ni()

p=nl()

s=[]

ans=0

min_v=10**6

for i in range(n):

    if i==0:

        ans+=1

        s.append(p[i])

        min_v=min(min_v,p[i])

        continue

    if p[i]<=min_v:

        ans+=1

    s.append(p[i])

    min_v=min(min_v,p[i])

print(ans)
n=int(eval(input()))

p=list(map(int,input().split()))

min_val=10**18

ans=0

for i in range(n):

  if i==0:

    min_val=p[i]

    ans+=1

    continue

  if min_val>=p[i]:

    min_val=p[i]

    ans+=1

print(ans)





# ABC 152 C
si = lambda: eval(input())
ni = lambda: int(eval(input()))
nm = lambda: list(map(int, input().split()))
snm = lambda: list(map(str, input().split()))
nl = lambda: list(map(int, input().split()))
n = ni()
p = nl()
s = []
ans = 0
min_v = 10**6
for i in range(n):
    if i == 0:
        ans += 1
        s.append(p[i])
        min_v = min(min_v, p[i])
        continue
    if p[i] <= min_v:
        ans += 1
    s.append(p[i])
    min_v = min(min_v, p[i])
print(ans)

n = int(eval(input()))
p = list(map(int, input().split()))
min_val = 10**18
ans = 0
for i in range(n):
    if i == 0:
        min_val = p[i]
        ans += 1
        continue
    if min_val >= p[i]:
        min_val = p[i]
        ans += 1
print(ans)

-# ABC 152 C -si = lambda: eval(input()) -ni = lambda: int(eval(input())) -nm = lambda: list(map(int, input().split())) -snm = lambda: list(map(str, input().split())) -nl = lambda: list(map(int, input().split())) -n = ni() -p = nl() -s = [] +n = int(eval(input())) +p = list(map(int, input().split())) +min_val = 10**18 -min_v = 10**6 +        min_val = p[i] -        s.append(p[i]) -        min_v = min(min_v, p[i]) -    if p[i] <= min_v: +    if min_val >= p[i]: +        min_val = p[i] -    s.append(p[i]) -    min_v = min(min_v, p[i])