using System; public class Program { public static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int type = 0; int miss = 0; for (int i = 0; i < n; i++) { string[] s = Console.ReadLine().Split(' '); int length = s[1].ToCharArray().Length; int able = 12 * int.Parse(s[0]) / 1000; if (length - able <= 0) { type += length; } else { type += able; miss += length - able; } } Console.WriteLine(type + " " + miss); } }