using System; using System.Collections.Generic; class Program { static void Main(string[] args) { var start = Console.ReadLine(); var end = Console.ReadLine(); var dic = new Dictionary() { { "N", 0 }, { "E", 1 }, { "S", 2 }, { "W", 3 } }; var diff = dic[end] - dic[start]; if (diff >= 0) Console.WriteLine(diff); else Console.WriteLine(4 + diff); } }