#include #include #include #include #include #include using namespace std; typedef long long LL; 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 -= 1; if(s[i] == 'E') x += 1; if(s[i] == 'W') x -= 1; if(s[i] == 'S') y += 1; } cout << setprecision(13) << sqrt(x*x + y*y) << endl; return 0; }