using System; public class Program { public static void Main(string[] args) { char[] c = Console.ReadLine().ToCharArray(); int x = 0; int y = 0; for (int i = 0; i < c.Length; i++) { switch(c[i]) { case 'N': y++; break; case 'W': x++; break; case 'E': x--; break; case 'S': y--; break; } } Console.WriteLine(Math.Sqrt(x*x + y*y)); } }