import java.util.Scanner object no35{ def main(args:Array[String]):Unit={ val scan:Scanner = new Scanner(System.in) val n = scan.nextInt var res_s = 0 var res_miss = 0 for(i <- 1 to n){ val lim = (12*scan.nextInt)/1000 val str = scan.next if(lim < str.length){ res_s += lim res_miss += str.length-lim }else{ res_s += str.length } } println(res_s+" "+res_miss) } }