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