N = int(eval(input()))

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



ans = 1

p = H[0]

for i in range(1,N):

    if p <= H[i]:

        ans += 1

        p = H[i]



print(ans)

N = int(eval(input()))

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



ans = 1

m = H[0]



for i in range(1,N):

    if H[i] >= m:

        ans += 1

        m = H[i]



print(ans)

N = int(eval(input()))
H = [int(i) for i in input().split()]
ans = 1
p = H[0]
for i in range(1, N):
    if p <= H[i]:
        ans += 1
        p = H[i]
print(ans)

N = int(eval(input()))
H = [int(i) for i in input().split()]
ans = 1
m = H[0]
for i in range(1, N):
    if H[i] >= m:
        ans += 1
        m = H[i]
print(ans)

-p = H[0] +m = H[0] -    if p <= H[i]: +    if H[i] >= m: -        p = H[i] +        m = H[i]