using System; using System.IO; using System.Linq; using System.Collections; using System.Collections.Generic; using System.Numerics; using System.Diagnostics; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using static System.Math; using static System.Console; namespace yukicoder { class Program { static void Main() { int n = int.Parse(Console.ReadLine()); int clear = 0; int fail = 0; for (int i = 0; i < n; i++) { var x = Console.ReadLine().Split().ToArray(); var type = (12 * int.Parse(x[0])) / 1000; if (x[1].Length > type) { clear += type; fail += x[1].Length - type; } else { clear += x[1].Length; } } Console.WriteLine(clear + " " + fail); } } }