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