package yukicoder; import java.util.Scanner; public class No_035 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); double ToET = 1000.0 / 12.0;//Time of each typeing int ST = 0;//Succeeded typeing int FT = 0; //Failed typeing for(int i = 0; i < N; i++){ int time = sc.nextInt(); String s = sc.nextLine(); int NoT = (int)Math.floor(time / ToET);//Number of times int VoL = s.length() - 1;//Value of Letter if(VoL > NoT){ ST += NoT; FT += (VoL - NoT); }else{ ST += VoL; } } System.out.println(ST + " " + FT); } }