using System; using System.Collections.Generic; using System.Linq; namespace Test { class Program { static void Main(string[] args) { string s = Console.ReadLine(); int tate = 0; int yoko = 0; for (int i = 0; i < s.Length; i++) { switch (s[i]) { case ('N'): { tate++; break; } case ('E'): { yoko++; break; } case ('S'): { tate--; break; } case ('W'): { yoko--; break; } } } double ret = Math.Abs(tate) * Math.Abs(tate); ret += Math.Abs(yoko) * Math.Abs(yoko); Console.WriteLine(Math.Sqrt(ret)); } } }