import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No00000113_Main2 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] arr = br.readLine().split(""); int x = 0; int y = 0; for(String s : arr) { switch(s) { case "N": y++; break; case "E": x++; break; case "W": x--; break; case "S": y--; break; default: break; } } System.out.println(Math.sqrt(x * x + y * y)); } }