using System; using System.Linq; public class P0113 { public static void Main() { var s = Console.ReadLine(); int x = 0; int y = 0; foreach(char c in s.ToCharArray()) { if(c == 'N') { y += 1; } else if (c == 'S') { y -= 1; } else if (c == 'E') { x += 1; } else { x -= 1; } } x = Math.Abs(x); y = Math.Abs(y); Console.WriteLine(Math.Pow(x*x + y*y, 0.5)); } }