#include using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; int main() { string str; cin >> str; auto N = count( str.begin(), str.end(), 'N' ); auto E = count( str.begin(), str.end(), 'E' ); auto W = count( str.begin(), str.end(), 'W' ); auto S = count( str.begin(), str.end(), 'S' ); cout << sqrt( pow( N - S, 2 ) + pow( E - W, 2 ) ) << endl; return 0; }