import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int x = 0, y = 0; for(char c : sc.next().toCharArray()){ if(c == 'N'){ y--; }else if(c == 'S'){ y++; }else if(c == 'W'){ x--; }else if(c == 'E'){ x++; } } System.out.printf("%.8f\n", Math.sqrt(x * x + y * y)); } }