#include #include #include int main() { char s[102]; scanf("%s", s); int x, y; x = y = 0; int i, n = strlen(s); for (i = 0; i < n; i++) { if (s[i] == 'N')y++; if (s[i] == 'E')x++; if (s[i] == 'S')y--; if (s[i] == 'W')x--; } printf("%.20lf\n", sqrt(x * x + y * y)); return 0; }