import java.util.Scanner; public class Main_yukicoder113 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] s = sc.next().toCharArray(); int x = 0; int y = 0; for (char e : s) { switch (e) { case 'N': y++; break; case 'E': x++; break; case 'W': x--; break; case 'S': y--; break; } } System.out.printf("%.3f\n", Math.sqrt(x * x + y * y)); sc.close(); } }