using System; using System.Collections.Generic; using System.Linq; class Magatro { static void Main() { string s = Console.ReadLine(); int n=0, e=0; for(int i = 0; i < s.Length; i++) { switch (s[i]) { case 'N': n++; break; case 'E': e++; break; case 'S': n--; break; case 'W': e--; break; } } Console.WriteLine(Math.Sqrt(n * n + e * e)); } }