#include #include using namespace std; int main() { int N; int T; string S; double type_speed = 12 / 1000.0; int sum = 0, correct = 0, miss = 0; cin >> N; for(int i = 0; i < N; ++i) { cin >> T >> S; sum += S.length(); correct += (S.length() < type_speed * T) ? S.length() : type_speed * T; } miss = sum - correct; cout << correct << ' ' << miss << endl; return 0; }