#include #include #include #include #include #include using namespace std; using uint = unsigned int; using ll = long long; #define CIN( LL , A ) LL A; cin >> A #define GETLINE( A ) string A; getline( cin , A ) int main() { CIN( string , S ); const uint& size = S.size(); ll x = 0; ll y = 0; for( ll i = 0 ; i < size ; i++ ){ const string s = S.substr( i , 1 ); if( s == "N" ){ y++; } else if( s == "E" ){ x++; } else if( s == "W" ){ x--; } else if( s == "S" ){ y--; } } const ll R2 = ( x * x + y * y ) * 10000; for( ll r = 0 ; r <= R2 ; r++ ){ if( r * r >= R2 ){ const double d = r / 100.0; cout << d << endl; return 0; } } return 0; }