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