#include int n,t,c,d,a,i;main(){std::string s;std::cin>>n;i=n;for(;i--;)std::cin>>t>>s,c+=t=(a=s.size())<(t*=.012)?a:t,d+=a-t;printf("%d %d\n",c,d);}