import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); char[] arr = sc.next().toCharArray(); int x = 0; int y = 0; for (char c : arr) { if (c == 'N') { y++; } else if (c == 'S') { y--; } else if (c == 'E') { x++; } else { x--; } } System.out.println(Math.sqrt(x * x + y * y)); } }