using System; public class Program { public static int CountChar(string str, char ch) { return str.Length - str.Replace(ch.ToString(), "").Length; } public static void Main() { string move = Console.ReadLine(); int n = CountChar(move, 'N'); int s = CountChar(move, 'S'); int e = CountChar(move, 'E'); int w = CountChar(move, 'W'); Console.WriteLine(Math.Sqrt((n - s) * (n - s) + (e - w) * (e - w))); } }