fun main(args: Array<String>) {
    var scoreA = 0
    var scoreB = 0
    val turnNum = readLine()!!.toInt()
    (0 until turnNum).forEach {
        val (cardA, cardB) = readLine()!!.split(" ")
        when {
            cardA == cardB -> {scoreA++; scoreB++}
            cardA > cardB -> scoreA += 3
            else -> scoreB += 3
        }
    }
    println("$scoreA $scoreB")
}

