#include //cin, cout #include //vector #include //sort,min,max #include //string #include //fixed #include //setprecision #include //swap using namespace std; int main() { int N, T; string S; unsigned int temp = 0; unsigned int ok = 0, ng = 0; cin >> N; for (int i = 0; i < N; i++) { cin >> T >> S; temp = T * 12 / 1000; if (S.length() <= T * 12 / 1000) { ok += S.length(); } else { ok += temp; ng += S.length() - temp; } } cout << ok << " " << ng << endl; return 0; }