using System; using System.Linq; class Program { static void Main(string[] args) { string S = Console.ReadLine(); double H = S.ToCharArray().Count(x => x == 'N') - S.ToCharArray().Count(x => x == 'S'); double W = S.ToCharArray().Count(x => x == 'E') - S.ToCharArray().Count(x => x == 'W'); Console.WriteLine(Math.Sqrt(Math.Pow(Math.Abs(H), 2) + Math.Pow(Math.Abs(W), 2))); } }