#include #include #include #include #include int main() { int y = 0; int x = 0; char str[101] = ""; scanf("%s", str); for (int i = 0;str[i] != '\0';i++) { if (str[i] == 'N') { y++; } else if (str[i] == 'E') { x++; } else if (str[i] == 'S') { y--; } else if (str[i] == 'W') { x--; } } y = abs(y); x = abs(x); printf("%.5lf", sqrt(x * x + y * y)); return 0; }