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