import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); double x = 0, y = 0; char c; for (int i = 0; i < s.length(); i++) { c = s.charAt(i); if (c == 'W') { x++; } else if (c == 'E') { x--; } else if (c == 'N') { y++; } else { y--; } } System.out.println(Math.sqrt(x * x + y * y)); } }