N=int(input()) T,S=[[int (i) for i in input(). split ()] for i in range (N)] C=12*T//1000 print (C) print (len(S)-C)