#include int main(void){ short n, t, correct, miss; char s[100]; float h = (float)1000 / 12; short i, j; scanf("%hd", &n); for(i = 0; i < n; i++){ scanf("%hd %s", &t, s); for(j = 0; s[j]; j++); if(t / h > j) correct += j; else correct += t / h; if(9 - (t / h) > 0){ miss += j - (t / h); if(j - (t / h) - (int)(j - (t / h))) miss++; } } printf("%hd %hd\n", correct, miss); return 0; }