import java.util.Scanner; public class Main{ public static void main(String args[])throws Exception{ Scanner sc = new Scanner(System.in); String S = sc.next(); int x = 0; int y = 0; int L = S.length(); for(int i=0;i<L;i++){ char c = S.charAt(i); switch(c){ case 'N': y++; break; case 'E': x++; break; case 'W': x--; break; case 'S': y--; break; } } System.out.println(Math.pow((double)(x*x+y*y), 0.5)); } }