using System; public class Program { public static void Main() { const int SPEED = 12; //高橋君の秒間タイプ数 int n = int.Parse(Console.ReadLine()); //区間数 int correct = 0; //タイプできた文字数 int miss = 0; //逃した文字数 for (int i = 0; i < n; i++) { string[] input = Console.ReadLine().Split(); int time = int.Parse(input[0]); //制限時間 int length = input[1].Length; //文字列の長さ int typed = Math.Min(SPEED*time/1000, length); correct += typed; miss += length - typed; } Console.WriteLine("{0} {1}", correct, miss); } }