#include #include int main(void){ int E = 0, N = 0, W = 0, S = 0, i,a,b,c,d; char S1[101]; scanf("%s", S1); for (i = 0; S1[i] != 0; i++) { if (S1[i] == 'E') { E++; } else if (S1[i] == 'N') { N++; } else if (S1[i] == 'W') { W++; } else if (S1[i] == 'S') { S++; } } printf("%lf", sqrt((double)((N - S)*(N - S) + (W - E)*(W - E)))); }