#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); string S; cin >> S; int x = 0, y = 0; for (char s : S) { if (s == 'N') y++; if (s == 'E') x++; if (s == 'W') x--; if (s == 'S') y--; } cout << fixed << setprecision(10) << sqrt(x * x + y * y) << '\n'; return 0; }