#include #include #include #include using namespace std; int main(){ string str; cin >> str; int y = 0; int x = 0; double ans; for(int d = 0; d < str.length(); d++){ switch(str[d]){ case 'N': y++; break; case 'W': x--; break; case 'E': x++; break; case 'S': y--; break; } } // cout << "x:" << x << " y:" << y << "x^2+y^2:" << x*x+y*y << endl; ans = sqrt(x*x+y*y); // cout <<"test:" << 1000*sqrt(x*x+y*y) << endl; cout << fixed << ans << endl; return 0; }