gray = []
brown = []
green = []
w_blue = []
blue = []
yellow = []
orange = []
red = []
seq = []
N = int(input())
a = list(map(int,input().split()))
for i in a:
    if 1 <= i < 400:
        gray.append(i)
    elif 400 <= i < 800:
        brown.append(i)
    elif 800 <= i < 1200:
        green.append(i)
    elif 1200 <= i < 1600:
        w_blue.append(i)
    elif 1600 <= i < 2000:
        blue.append(i)
    elif 2000 <= i < 2400:
        yellow.append(i)
    elif 2400 <= i < 2800:
        orange.append(i)
    elif 2800 <= i < 3200:
        red.append(i)
    else:
        seq.append(i)

L = [gray,brown,green,w_blue,blue,yellow,orange,red]
ans = 0
for i in L:
    if len(i) >= 1:
        ans += 1
        print(i)
if ans != 0:
    print(ans,ans+len(seq))
else:
    print(1,len(seq))