#include using namespace std; int main() { int N, can_type = 0, cannot_type = 0; cin >> N; while (N--) { int T; string S; cin >> T >> S; int can = min(12 * T / 1000, (int)S.size()); can_type += can; cannot_type += S.size() - can; } cout << can_type << " " << cannot_type << endl; return 0; }