

object Main extends App {
  override def main(args: Array[String]): Unit = {
    val n = io.StdIn.readLine.toInt

    val seq = (1 to n).map(_ => io.StdIn.readLine.split(' ').toList)

    val (taro, hanako) = solve(seq)

    println(taro + " " + hanako)

  }

  def solve(seq: Seq[List[String]]): (Int, Int) = {
    seq.map(l => (l(0) compareTo l(1)) match {
      case 0          => (1, 1)
      case n if n < 0 => (0, 3)
      case n if n > 0 => (3, 0)
    }).reduce((z, n) => (z._1 + n._1, z._2 + n._2))
  }
}