object Main extends App {
  val n = readLine.toInt

  var t = 0
  var h = 0

  for (i <- 0 until n) {
    val Seq(st, sh) = readLine.split(' ').toList
    if (st > sh)
      t += 3
    else if (st < sh)
      h += 3
    else {
      t += 1
      h += 1
    }
  }

  println("%d %d".format(t, h))
}
