n=int(input())

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

c=[0]*8

mx=0

for i in range(n):

    if 1<=a[i]<400:

        c[0]=1

    elif 400<=a[i]<800:

        c[1]=1

    elif 800<=a[i]<1200:

        c[2]=1

    elif 1200<=a[i]<1600:

        c[3]=1

    elif 1600<=a[i]<2000:

        c[4]=1

    elif 2000<=a[i]<2400:

        c[5]=1

    elif 2400<=a[i]<2800:

        c[6]=1

    elif 2800<=a[i]<3200:

        c[7]=1

    else:

        mx+=1

print(max(1,sum(c)),sum(c)+mx)
n=int(input())

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

c=[0]*8

mx=0

for i in range(n):

    if a[i]/400<=7:

        c[a[i]/400]=1

    else:

        mx+=1

print(max(1,sum(c)),sum(c)+mx)
n = int(input())
a = list(map(int, input().split()))
c = [0] * 8
mx = 0
for i in range(n):
    if 1 <= a[i] < 400:
        c[0] = 1
    elif 400 <= a[i] < 800:
        c[1] = 1
    elif 800 <= a[i] < 1200:
        c[2] = 1
    elif 1200 <= a[i] < 1600:
        c[3] = 1
    elif 1600 <= a[i] < 2000:
        c[4] = 1
    elif 2000 <= a[i] < 2400:
        c[5] = 1
    elif 2400 <= a[i] < 2800:
        c[6] = 1
    elif 2800 <= a[i] < 3200:
        c[7] = 1
    else:
        mx += 1
print(max(1, sum(c)), sum(c) + mx)

n = int(input())
a = list(map(int, input().split()))
c = [0] * 8
mx = 0
for i in range(n):
    if a[i] / 400 <= 7:
        c[a[i] / 400] = 1
    else:
        mx += 1
print(max(1, sum(c)), sum(c) + mx)

-    if 1 <= a[i] < 400: -        c[0] = 1 -    elif 400 <= a[i] < 800: -        c[1] = 1 -    elif 800 <= a[i] < 1200: -        c[2] = 1 -    elif 1200 <= a[i] < 1600: -        c[3] = 1 -    elif 1600 <= a[i] < 2000: -        c[4] = 1 -    elif 2000 <= a[i] < 2400: -        c[5] = 1 -    elif 2400 <= a[i] < 2800: -        c[6] = 1 -    elif 2800 <= a[i] < 3200: -        c[7] = 1 +    if a[i] / 400 <= 7: +        c[a[i] / 400] = 1