#include using namespace std; signed main(){ string S; cin >> S; int x = 0, y = 0; for( int i = 0; i < S.size(); ++i ){ if( S[ i ] == 'N' ) ++x; if( S[ i ] == 'W' ) --y; if( S[ i ] == 'E' ) ++y; if( S[ i ] == 'S' ) --x; } cout << fixed << setprecision( 13 ) << sqrt( x * x + y * y ) << endl; return 0; }