#include #include using namespace std; int main() { int x = 0, y = 0; string s; cin >> s; for (char c : s) { if (c == 'N') y++; else if (c == 'E') x++; else if (c == 'W') x--; else if (c == 'S') y--; } double ans = sqrt(x * x + y * y); cout << ans << endl; return 0; }