import numpy as np

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

#calc binCount
binCount=np.zeros(9)
for rate in arr:
    rateBin=rate//400
    binCount[min(rateBin,8)]+=1
print(binCount)

colorCount=int(np.sum(binCount[:-1]>0))
nc=int(np.sum(binCount[:-1]))
nf=int(binCount[-1])
assert N==nc+nf
print(colorCount, nc, nf)

if nc>0:
    minColor=colorCount
elif nf>0:
    minColor=1
else:
    minColor=0

maxColor=int(min(colorCount+nf, 8))
print(minColor, maxColor)