#include #include #include using namespace std; int main(int argc, const char* argv[]) { string S; cin >> S; map m; for (auto&& c : S) m[c]++; int x = m['E'] - m['W']; int y = m['N'] - m['S']; cout << sqrt(x * x + y * y) << endl; return 0; }