let () =
  let rec duel taro hana = function
      0 -> (taro, hana)
    | i ->
       let hd, tl = Scanf.scanf "%s %s\n" (fun x y -> x, y) in
       if hd > tl then duel (taro + 3) hana (i-1)
       else if hd = tl then duel (taro + 1) (hana + 1) (i-1)
       else duel taro (hana + 3) (i-1)
  in
  let n = read_int () in
  duel 0 0 n
  |> (fun (x, y) -> Printf.printf "%d %d\n" x y) ;;
