#include #include #include using namespace std; int main() { string s; cin >> s; int x = 0; int y = 0; for(const char c:s){ if(c == 'N'){ y++; } else if(c == 'E'){ x++; } else if(c == 'W'){ x--; } else { y--; }} cout << fixed << setprecision(16) << hypot(x,y) << endl; return 0; }