using System; public class Program { const double typeAbility = 0.012; public static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); var strs = string.Empty; var totalTyped = 0; for (int i = 0; i < n; i++) { var input = Console.ReadLine().Split(' '); var typed = (int)(typeAbility * int.Parse(input[0])); totalTyped += (typed >= input[1].Length) ? input[1].Length : typed; strs += input[1]; } Console.WriteLine("{0} {1}", totalTyped, strs.Length - totalTyped); } }