object Main {
  def main(args: Array[String]): Unit = {
    var a, b = 0
    val n = io.StdIn.readInt()
    for (_ <- 0 until n) {
      val Array(ca, cb, _*) = io.StdIn.readLine().split(" ")
      val c = ca.compareTo(cb)
      if (c > 0) {
        a += 3
      } else if (c < 0) {
        b += 3
      } else {
        a += 1
        b += 1
      }
    }
    println(s"$a $b")
  }
}