object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val games = List.fill(n, 2)(sc.next())
  val referee = createReferee
  games.foreach(judge(_, referee))
  println(referee(0).taro + " " + referee(0).hanako)

  def createReferee: (Int) => ScoreSet = {
    // (taro, hanako)
    var score = ScoreSet(0, 0)
    // 0:output, 1: taro-win, 2: hanako-win, 3: draw
    (judge: Int) => {
      judge match {
        case 0 => score
        case 1 => score = ScoreSet(score.taro + 3, score.hanako); score
        case 2 => score = ScoreSet(score.taro, score.hanako + 3); score
        case 3 => score = ScoreSet(score.taro + 1, score.hanako + 1); score
      }
    }
  }

  def judge(game: List[String], referee: (Int) => ScoreSet): ScoreSet = {
    game match {
      case _ if game(0) == game(1) => referee(3)
      case _ if game.sorted == game => referee(2)
      case _ if game.sorted != game => referee(1)
    }
  }

  case class ScoreSet(taro: Int, hanako: Int)

}