module main; import std; void main() { auto N = readln.chomp.to!int; int ok = 0, ng = 0; foreach (_; 0 .. N) { int T; string S; readln.chomp.formattedRead("%d %s", T, S); int len = S.length.to!int, typed = min((T * 12) / 1000, len); ok += typed, ng += len - typed; } writefln("%d %d", ok, ng); }