N=int(input()) T=[[i for i in input(). split ()] for i in range (N)] #rint (T) C=0 Cs=0 for i in range (N): T[i][0]=int(T[i][0]) C+=12*T[i][0]//1000 Cs+=len(T[i][1]) # print (Cs) R=Cs*N-C C=str(C) R=str(R) print (C+" "+R)