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