#include #include //using namespace std; typedef unsigned long long ul; typedef signed long long ll; int main(void) { std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed; std::string s; std::cin >> s; int x = 0, y = 0; for (auto c : s) { if (c=='N') y++; if (c=='S') y--; if (c=='E') x++; if (c=='W') x--; } std::cout << sqrt(x*x + y*y) << std::endl; return 0; }