#include using namespace std; #define REP(i, n) for(int i = 0; i < n; i++) int main() { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; int tot = 0, correct = 0; REP(i, N) { 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; }