#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long MOD = 1000000007; int main() { string S; cin >> S; int x = 0; int y = 0; for ( int i = 0; i < S.length(); i++ ) { if ( S[i] == 'N' ) { x++; } if ( S[i] == 'S' ) { x--; } if ( S[i] == 'E' ) { y++; } if ( S[i] == 'W' ) { y--; } } x = abs(x); y = abs(y); printf( "%f", sqrt( x*x + y*y ) ); return 0; }