n=int(input()) ans=0;err=0 for _ in range(n): a,b=input().split() a=int(a);s=len(b) tmp=(a*12)//1000 ans+=tmp err+=s-tmp print(asn,err)