class C{ public static void main(String[]$){ int x=0,y=0; for(char c:new java.util.Scanner(System.in).next().toCharArray()) { if(c=='N')++y; if(c=='E')++x; if(c=='W')--x; if(c=='S')--y; } System.out.println(Math.sqrt(x*x+y*y)); } }