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]; double n = (double)12 / 1000; 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 (strings[1].Length < (double)(num * n)) { type += strings[1].Length; } else { int temp = (int)Math.Floor((double)num * n);//ミスタイプ用一時受け取り type += (int)Math.Floor((double)num * n); losstype += strings[1].Length - temp; } } Console.WriteLine(type + " " + losstype); } } }