/**
  * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_9_C&lang=jp
  * ITP1_9_C
  */
object Main {
  def main(args: Array[String]): Unit = {
    val turns = io.StdIn.readInt()
    val finalScores = Iterator.continually(io.StdIn.readLine()).takeWhile(_ != null).take(turns)
      .map(_.split(" ")).map { case Array(tarosCard, hanakosCard) => (tarosCard, hanakosCard) }
      .foldLeft((0, 0)) { (currentScores, cards) =>
        cards match {
          case (tarosCard, hanakosCard) if tarosCard > hanakosCard => (currentScores._1 + 3, currentScores._2)
          case (tarosCard, hanakosCard) if tarosCard == hanakosCard => (currentScores._1 + 1, currentScores._2 + 1)
          case (tarosCard, hanakosCard) if tarosCard < hanakosCard => (currentScores._1, currentScores._2 + 3)
        }
      }
    println(s"${finalScores._1} ${finalScores._2}")
  }
}