#include #include #include #include int main(){ char str[100]; int len, i; int width = 0, height = 0; double dist = 0; scanf("%s", str); len = strlen(str); for(i = 0; i < len; i++){ if(str[i] == 'N'){ height++; }else if(str[i] == 'E'){ width++; }else if(str[i] == 'S'){ height--; }else if(str[i] == 'W'){ width--; } } dist = sqrt(height*height + width*width); printf("%lf\n", dist); return 0; }