import scala.io.Source

object Main extends App {
  val src = Source.stdin.getLines

  val turns: Int = src.next.toInt

  def versus(n: Int, acc: List[Int]): List[Int] = {
    if (n <= 0) acc
    else { val Array(taro, hana) = src.next.split(" ")
           if (taro > hana) versus(n - 1, acc.updated(0, acc(0) + 3))
           else if (taro < hana) versus(n - 1, acc.updated(1, acc(1) + 3))
           else versus(n - 1, acc.map(x => x + 1))
    }
  }

  val result: List[Int] = versus(turns, List(0, 0))
  println(result.mkString(" "))
}