#include #include int main() { char input[101]; int i, x = 0, y = 0; scanf("%s", input); for (i = 0; input[i] !='\0'; i++) { if (input[i] == 'N') y--; else if (input[i] == 'S') y++; else if (input[i] == 'W') x--; else x++; } printf("%lf\n", sqrt(pow((double)x, 2.0) + pow((double)y, 2.0))); return 0; }