#include #include using namespace std; int calc(int t, string s); int main(){ int n, t, a, b, l; a = 0, b = 0; cin >> n; string s; for ( int i = 0; i < n; i++ ){ cin >> t >> s; l = s.size(); int maxtype = t*12/1000; a = a + min(maxtype, l); if (maxtype < l) b = b + l - maxtype; } cout << a << " " << b << endl; return 0; }