using System.Collections.Generic; using System; public class Hello { static void Main() { var a = Console.ReadLine().Trim(); var b = Console.ReadLine().Trim(); getAns(a, b); } static void getAns(string a, string b) { var d = new Dictionary(); d["N"] = 0; d["E"] = 1; d["S"] = 2; d["W"] = 3; var ans = d[b] - d[a]; Console.WriteLine(ans >= 0 ? ans : ans + 4); } }