// No.113 宝探し // https://yukicoder.me/problems/no/113 // #include #include #include #include using namespace std; double solve(string &S); int main() { string S; cin >> S; double ans = solve(S); cout << fixed << setprecision(5) << ans << endl; } double solve(string &S) { int x = 0; int y = 0; for (char s: S) { switch (s) { case 'N': y--; break; case 'E': x++; break; case 'W': x--; break; case 'S': y++; break; } } return sqrt(x*x + y*y); }