from collections import Counter





def get_color(rating):

    if rating >= 3200:

        return 8

    else:

        return rating // 400





eval(input())

a = Counter([get_color(int(x)) for x in input().split()])

min_color_cnt = len([i for i in a if i < 8])

print((max(1, min_color_cnt), min_color_cnt + a[8]))

eval(input())

super_coders_cnt = 0

coders = set()

for r in map(int, input().split()):

    if r >= 3200:

        super_coders_cnt += 1

    else:

        coders.add(r // 400)

print((max(1, len(coders)), len(coders) + super_coders_cnt))

from collections import Counter


def get_color(rating):
    if rating >= 3200:
        return 8
    else:
        return rating // 400


eval(input())
a = Counter([get_color(int(x)) for x in input().split()])
min_color_cnt = len([i for i in a if i < 8])
print((max(1, min_color_cnt), min_color_cnt + a[8]))

eval(input())
super_coders_cnt = 0
coders = set()
for r in map(int, input().split()):
    if r >= 3200:
        super_coders_cnt += 1
    else:
        coders.add(r // 400)
print((max(1, len(coders)), len(coders) + super_coders_cnt))

-from collections import Counter - - -def get_color(rating): -    if rating >= 3200: -        return 8 +eval(input()) +super_coders_cnt = 0 +coders = set() +for r in map(int, input().split()): +    if r >= 3200: +        super_coders_cnt += 1 -        return rating // 400 - - -eval(input()) -a = Counter([get_color(int(x)) for x in input().split()]) -min_color_cnt = len([i for i in a if i < 8]) -print((max(1, min_color_cnt), min_color_cnt + a[8])) +        coders.add(r // 400) +print((max(1, len(coders)), len(coders) + super_coders_cnt))