import java.util.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { int x = 0; int y = 0; String s = sc.next(); for (int i = 0;i < s.length();i++) { if (s.charAt(i) == 'N') y++; if (s.charAt(i) == 'E') x++; if (s.charAt(i) == 'W') y--; if (s.charAt(i) == 'S') x--; } System.out.println(Math.sqrt(Math.pow(x,2)+Math.pow(y,2))); } }