using System; public class Program { public static void Main() { //int num = int.Parse(Console.ReadLine() ?? string.Empty); //string[] str = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); string str = Console.ReadLine() ?? string.Empty; //E6 S7 W4 N3 = s4 e2 int e = 0; int s = 0; int w = 0; int n = 0; for (int i = 0; i < str.Length; i++) { if (str[i] == 'E') { e++; } else if (str[i] == 'S') { s++; } else if (str[i] == 'W') { w++; } else { n++; } } int a = ((n - s) * (n - s)) + ((e - w) * (e - w)); double d = Math.Sqrt(a); Console.WriteLine(d); } }