#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ull = unsigned long long; using ll = long long; int main() { string s; cin >> s; int x = 0; int y = 0; for(auto&& data : s) { switch(data) { case 'W': --x; break; case 'E': ++x; break; case 'N': --y; break; case 'S': ++y; break; } } cout << fixed << setprecision(10) << hypot(x,y) << endl; }