#include #include #include #include #include using namespace std; int main() { vector cnt(26, 0); string S; cin >> S; for( int i = 0; i < S.size(); i++ ) { cnt[S[i]-'A'] ++; } double x, y; x = abs( cnt['N'-'A'] - cnt['S'-'A'] ); y = abs( cnt['W'-'A'] - cnt['E'-'A'] ); cout << sqrt( x * x + y * y ) << endl; return 0; }