using System; namespace yukicoder { class Program { static void Main(string[] args) { int a = int.Parse(Console.ReadLine()); double b= 12; b /= 1000; double c = 0; double[] d = new double[a]; double[] e = new double[a]; double ans = 0; double ans1 = 0; for (int i = 0; i < a; i++) { string[] s = Console.ReadLine().Split(' '); c = double.Parse(s[0]); c = Math.Floor(c * b); if (c >s[1].Length) { c = s[1].Length; } d[i] = c; e[i]=s[1].Length - c; } for(int j = 0; j < a; j++) { ans += d[j]; ans1 += e[j]; } Console.WriteLine("{0} {1}", ans, ans1); } } }