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