import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int n = s.length(); int x = 0, y = 0; for(int i = 0 ; i < n ; i++) { if(s.charAt(i) == 'N') { y++; } else if(s.charAt(i) == 'S') { y--; } else if(s.charAt(i) == 'E') { x++; } else { x--; } } System.out.printf("%.5f\n", Math.pow(Math.abs(x * x + y * y), 0.5)); } }