#include #include int main(){ int i = 0, x = 0, y = 0; char s[101]; scanf("%s", s); while(s[i] != '\0'){ switch(s[i++]){ case 'N': y++; break; case 'E': x++; break; case 'W': x--; break; case 'S': y--; break; } } printf("%f\n", sqrt((double)(x * x + y * y))); return 0; }