#include int count(char *str){ int i = 0; while(str[i++] != '\0'); return --i; } int main(){ int N, time; int suc = 0, fai = 0; int i; char str[101]; scanf("%d", &N); for(i = 0; i < N; i++){ scanf("%d %s", &time, str); suc += (12*time/1000) > count(str) ? count(str) : (12 * time/1000); fai += (12*time/1000) > count(str) ? 0 : count(str) - (12 * time/1000); } printf("%d %d\n", suc, fai); return 0; }