package Yukicoder fun main(args: Array) { fun readLineLongArray(): List { val str = readLine() as String val arrStr = str.split(" ") val ret = arrStr.map { it.toLong() } return ret } fun readLineLong(): Long { val str = readLine() as String return str.toLong() } fun readLineInt(): Int { val str = readLine() as String return str.toInt() } fun readLineIntArray() : List { val str = readLine() as String val arrStr = str.split(" ") val ret = arrStr.map { it.toInt() } return ret } fun readLineDoubleArray(): List { val str = readLine() as String val arrStr = str.split(" ") val ret = arrStr.map { it.toDouble() } return ret } fun readLineDouble() : Double { val str = readLine() as String return str.toDouble() } fun readLineString() : String { return readLine() as String } // fun readLineStringArray(): List { // val str = readLine() as String // val arrStr = str.split(" ") // return arrStr // } val num = readLineInt() var typicableNum = 0 var unTypicableNum = 0 val sen = 1000 val canType = 12 for (i in 1..num) { val input = readLineString().split(" ") val tmpTime = input[0].toInt() val tmpLen = input[1].length val tmpTypicableNum = canType * tmpTime / sen if (tmpTypicableNum >= tmpLen) { typicableNum += tmpLen } else { typicableNum += tmpTypicableNum unTypicableNum += tmpLen - tmpTypicableNum } } println(typicableNum.toString() + " " + unTypicableNum) }