using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace foryuki { class Program { static void Main(string[] args) { char[] S = Console.ReadLine().ToCharArray(); int x = 0; int y = 0; foreach (var c in S) { switch (c) { case 'E': x += 1; break; case 'S': y -= 1; break; case 'W': x -= 1; break; case 'N': y += 1; break; } } double ans = Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2)); Console.WriteLine(ans); } //------------------------------------------------------------- static int[] ConvertStringArrayToIntArray(string[] str, int defaultValue) { int[] b = Array.ConvertAll(str, delegate(string value) { return int.Parse(value); }); for (int i = 0; i < b.Length; i++) { b[i] = defaultValue; } return b; } } }