#include #include #include using namespace std; int main() { int n; cin >> n; int tm; string str; int ok = 0; int ng = 0; for (int i = 0; i < n; i++) { cin >> tm >> std::ws >> str; int tp = floor((tm / 1000.0) * 12); if (str.length() > tp) { ok += tp; ng += str.length() - tp; } else { ok += str.length(); } } cout << ok << " " << ng << endl; }