#include using namespace std; int main() { int N; cin >> N; int tot = 0, correct = 0; for (int i = 0; i < N; ++i) { int t; string s; cin >> t >> s; int len = s.size(); tot += len; correct += min(len, (t * 12) / 1000); } int wrong = tot - correct; cout << correct << " " << wrong << endl; return 0; }