#include #include using namespace std; int main() { int N; cin >> N; int T; string s; int count = 0, badtype = 0; for (int i = 0; i < N; i++){ cin >> T >> s; //正しく入力出来る文字数 int truetype = ((12 * T) / 1000); if (s.length() <= truetype){ count += s.length(); } else{ count += truetype; badtype += (s.length() - truetype); } } cout << count << " " << badtype << endl; }