#include #include #include int main() { char s[105]; int e = 0, n = 0; scanf("%s", s); for (int i=0;s[i];i++){ s[i]=='N'?n++:n; s[i]=='E'?e++:e; s[i]=='W'?e--:e; s[i]=='S'?n--:n; } printf("%lf", (double)sqrt(e * e + n * n)); }