using System; public class Test { public static void Main() { var s = Console.ReadLine(); int x = 0; int y = 0; foreach(char c in s) { if(c == 'N') y++; else if(c == 'S') y--; else if(c == 'E') x++; else x--; } Console.WriteLine(Math.Sqrt(x * x + y * y)); } }