import scala.io.StdIn

/**
  * AOJ
  */
object Main {

  def main(args: Array[String]): Unit = {

    val p = new Point(0,0)
    val n = StdIn.readInt()
    for(_ <- 1 to n){
      val animals = StdIn.readLine().split(" ")
      if(animals(0) > animals(1)){
        p.taro += 3
      } else if(animals(0) < animals(1)){
        p.hanako += 3
      } else {
        p.taro += 1
        p.hanako += 1
      }
    }
    println(p.taro + " " + p.hanako)
  }
  class Point(var taro:Int,var hanako:Int)
}