#include #include #include int main(){ std::string s; std::cin >> s; double x = 0, y = 0; for (int i = 0; i < s.size(); ++i){ if (s[i] == 'S')y--; if (s[i] == 'N')y++; if (s[i] == 'E')x++; if (s[i] == 'W')x--; } std::cout << sqrt(x*x + y*y) << std::endl; return 0; }