using System; namespace yukicoder { class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); int type = 0 , losstype = 0 , num = 0; string[] strings = new string[N]; //1文字のタイピング時間 int n = 1000 / 12; double m = ((1000 % 12) - 1) * 0.1; double sum = n + m; for (int i= 0; i < N; i++) { var str = Console.ReadLine(); var g = str.Split(" "); strings[0] = g[0];//入力された文字を配列に strings[1] = g[1]; num = int.Parse(strings[0]); if (num > strings[1].Length * sum) { type += strings[1].Length; } else { int temp = (int)(num / sum);//一時受け取り type = (int)(type + (num / sum)); losstype = losstype + (strings[1].Length - temp);//1行分のミスタイプ } } Console.WriteLine(type + " " + losstype); } } }