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