#include #include #include int main() { using namespace std; int n, ac = 0, wa = 0; cin >> n; while (n--) { int t; string s; cin >> t >> s; int sz = s.size(); int mx = t * 12 / 1000; ac += min(sz, mx); wa += max(sz - mx, 0); } cout << ac << " " << wa << endl; }