import java.util.Scanner

fun main(args:Array<String>){

    val cin = Scanner(System.`in`)
    val n = cin.nextInt()
    var taro:Int = 0
    var hanako:Int = 0
    
    for(i in 1..n){
	    val str1 = cin.next()
	    val str2 = cin.next()
        when{
	        str1 > str2 -> {taro += 3}
	        str1 < str2 -> {hanako += 3}
	        else -> {
		        taro++
		        hanako++
	        }
	    }
    }
    println("${taro} ${hanako}")
}

