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