import java.util.*; import java.math.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] in = sc.next().toCharArray(); int x = 0; int y = 0; for(int i = 0; i < in.length; i++) { if(in[i] == 'N') y++; if(in[i] == 'S') y--; if(in[i] == 'W') x--; if(in[i] == 'E') x++; } double ans = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); System.out.printf("%.20f\n",ans); } }