using System.Numerics; public class Program { public static void Main() { //int num = int.Parse(Console.ReadLine() ?? string.Empty); //string[] str = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); string str = Console.ReadLine() ?? string.Empty; string str2 = Console.ReadLine() ?? string.Empty; if (str == str2) { Console.WriteLine(0); } else { int s = 0; int e = 0; if (str == "E") { s = 1; } else if (str == "W") { s = 3; } else if (str == "S") { s = 2; } else { s = 4; } if (str2 == "E") { e = 1; } else if (str2 == "W") { e = 3; } else if (str2 == "S") { e = 2; } else { e = 4; } if (s == 4) { Console.WriteLine(e); } else { int g = int.Parse((s - e).ToString().Replace("-", "")); Console.WriteLine(g); } } } }