#include using namespace std; int main() { string s; cin >> s; int x = 0, y = 0; for (int i = 0; i < s.size(); i++) { char c = s.at(i); if (c == 'N') y++; if (c == 'E') x++; if (c == 'W') x--; if (c == 'S') y--; } x *= x; y *= y; int sum = x + y; double a = sqrt(sum); cout << a << endl; }