using System; using System.Linq; using System.Collections.Generic; class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int total = 0; int miss = 0; for (int i = 0; i < n; i++) { string[] s = Console.ReadLine().Split(); int m = (int.Parse(s[0]) * 12) / 1000; if (m >= s[1].Length) { total += s[1].Length; } else { total += m; miss += s[1].Length - m; } } Console.WriteLine("{0} {1}", total, miss); Console.ReadLine(); } }