#include #include #include int main(int argc, char const *argv[]) { int x = 0, y = 0; std::string buffer; std::getline(std::cin, buffer, '\n'); for (auto i : buffer){ switch (i){ case 'W': --x; break; case 'N': ++y; break; case 'E': ++x; break; case 'S': --y; break; } } std::cout << sqrt(x*x + y*y) << std::endl; return 0; }