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