import java.util.Scanner; public class Main { public static void main(String[] a) { Scanner s = new Scanner(System.in); int x=0,y=0; for(char c:s.nextLine().toCharArray()){ x+=c=='W'?-1:c=='E'?1:0; y+=c=='N'?-1:c=='S'?1:0; } System.out.println(Math.sqrt(x*x+y*y)); } }