#include using namespace std; int main() { // 1. 入力情報取得. int N; cin >> N; // 2. 正解, 不正解 を集計. int correct = 0; int wrong = 0; for(int i = 0; i < N; i++){ int t; string s; cin >> t >> s; int maxType = floor(12.0 * t / 1000); int l = s.size(); if(l > maxType) correct += maxType, wrong += (l - maxType); else correct += l; } // 3. 出力. cout << correct << " " << wrong << endl; return 0; }