#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair Pr; int N; int good_type, mis_type; int main() { cin >> N; for (int i = 0; i < N; i++) { int T,s_length; string S; cin >> T >> S; s_length = S.length(); if (s_length > (12 * T) / 1000) { mis_type += s_length - ((12 * T) / 1000); good_type += (12 * T) / 1000; } else { good_type += s_length; } } printf("%d %d\n",good_type,mis_type); return 0; }