import java.util.Scanner; public class No00000035_Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int typeCnt= 0; int nonTypeCnt = 0; int n = Integer.parseInt(scan.nextLine()); for(int i = 0; i < n; i++) { int cnt = (int) (12 * scan.nextDouble()) /1000; int strLength = scan.nextLine().trim().length(); if(strLength <= cnt) { typeCnt += strLength; } else { typeCnt += cnt; nonTypeCnt += strLength - cnt; } } System.out.println(typeCnt + " " + nonTypeCnt); scan.close(); } }