#include #include #include #include #include using ll = long long; using namespace std; constexpr ll INF = 1LL << 60; string s; int main() { cin >> s; int x = 0, y = 0; for (char c : s) { if (c == 'N') ++y; if (c == 'E') ++x; if (c == 'W') --x; if (c == 'S') --y; } cout << fixed << setprecision(10) << sqrt(x * x + y * y) << endl; return 0; }