char a[99];s,m,t;main(c){for(gets(a);~scanf("%d%s",&t,a);t*=.012,s+=t>c?c:t)m+=c=strlen(a);m=!printf("%d %d",s,m-s);}