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