#include #include #include using namespace std; int main(void){ int ok = 0, ng = 0; int n; cin >> n; for (int i = 0; i < n; i++){ int t; string s; cin >> t >> s; int tmp = min(t * 12 / 1000, (int)s.length()); ok += tmp; ng += s.length() - tmp; } cout << ok << " " << ng << endl; return 0; }