import scala.io.StdIn.{readLine,readInt}

object Main extends App {
  val n = readInt
  var taro = 0
  var hanako = 0

  for(i <- 1 to n) {
    val l = readLine.split(" ")

    if(l(0) > l(1)) taro += 3
    else if(l(0) < l(1)) hanako += 3
    else { taro += 1;hanako += 1 }
  }

  println(taro + " " + hanako)
}