let () =
  let game times =
    let rec loop a b = function
        0 -> a,b
      | i ->
        let x,y = Scanf.scanf "%s %s\n"
            (fun x y -> if x>y then 3,0 else if x<y then 0,3 else 1,1) in
        loop (a+x) (b+y) (i-1)
    in loop 0 0 times
  in
  let times = read_int () in
  let a,b = game times in
  Printf.printf "%d %d\n" a b