#include #define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false)) #define precise(i) fixed << setprecision(i) #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { fastIO; int x = 0, y = 0; string s; cin >> s; for (const auto ch : s) { if (ch == 'N') { y++; } else if (ch == 'S') { y--; } else if (ch == 'W') { x++; } else if (ch == 'E') { x--; } } cout << precise(5) << sqrt(x * x + y * y) << '\n'; }