import java.util.Scanner; public class Takarasagasi { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = 0,y = 0; double d; String s = sc.next(); for (int i = 0; i < s.length() ; i++ ) { char a = s.charAt(i); if (a == 'N') { x = x + 1; }else if (a == 'S') { x = x - 1; }else if (a == 'W') { y = y + 1; }else if (a =='E') y = y - 1; } d = Math.sqrt(x*x + y*y); System.out.println(d ); } }