import java.util.Scanner; public class No35 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int typeCnt = 0; int missCnt = 0; for (int i = 0; i < n; i++) { double t = sc.nextDouble(); String s = sc.next(); int type = (int) Math.floor((12 * t) / 1000); if (type > s.length()) { type = s.length(); } int miss = s.length() - type; typeCnt += type; missCnt += miss; } System.out.println(typeCnt + " " + missCnt); sc.close(); } }