#include using namespace std; int main(void) { cout << fixed << setprecision(15); string S; cin >> S; int x = 0, y = 0; for(auto c : S) { if(c == 'E') x += 1; if(c == 'W') x -= 1; if(c == 'N') y += 1; if(c == 'S') y -= 1; } cout << sqrt(x * x + y * y) << "\n"; return 0; }