N=int(input()) O,M=0,0 for i in range(N): L=input().split() A=int(int(L[0])*12/1000) B=len(L[1]) M+=B if A