import java.io.*; import java.util.*; class Main113 { public static void out (Object o) { System.out.println(o); } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); int x = 0 , y = 0; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == 'N') y--; else if (c == 'E') x++; else if (c == 'W') x--; else y++; } x = Math.abs(x); y = Math.abs(y); out(Math.sqrt(x * x + y * y)); } }