Scanf.scanf "%c %c" (fun a b -> let f = String.index "NESW" in Printf.printf "%d\n" @@ ((f b - f a + 4) mod 4) )