import java.util.*

fun main(args: Array<String>) {
    var taroPoint = 0
    var hanakoPoint = 0

    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    (1..n).forEach {
        val card1 = scanner.next()
        val card2 = scanner.next()
        if (card1 > card2) {
            taroPoint += 3
        } else if (card1 < card2) {
            hanakoPoint += 3
        } else {
            taroPoint++
            hanakoPoint++
        }
    }
    println("${taroPoint} ${hanakoPoint}")
}
