using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); int allstr = 0; int tnum = 0; int miss = 0; for (int i = 0; i < N; i++) { string[] strTS = Console.ReadLine().Split(' '); int type = int.Parse(strTS[0]) * 12 / 1000; int str = strTS[1].Length; if (str > type) { tnum = tnum + type; } else { tnum = tnum + str; } allstr = allstr + str; } miss = allstr - tnum; Console.WriteLine(tnum + " " + miss); } } }