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

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

  for (_ <- 1 to n) {
    val Array(tCard, hCard) = readLine.split(" ")
    if (tCard > hCard) taro += 3
    else if (tCard == hCard) {
      taro += 1
      hanako += 1
    }
    else hanako += 3
  }

  println(taro + " "+ hanako)
}
