using System; namespace Yukicoder { class Program { static void Main(string[] args) { var N = int.Parse(Console.ReadLine()); int typed = 0; int cantType = 0; for (int i = 0; i < N; i++) { var K = Console.ReadLine().Split(' '); int TK = int.Parse(K[0]); int SK = K[1].Length; if(TK * 12 / 1000 >= SK) { typed += SK; }else { typed += (TK * 12 / 1000); cantType += SK - (TK * 12 / 1000); } } Console.WriteLine("{0} {1}", typed, cantType); } } }