#include #include #include #include #include using namespace std; int main(){ string str; int x=0,y=0; cin >> str; for(int i=0;str[i]!='\0';i++){ if(str[i]=='N') x++; else if(str[i]=='S') x--; else if(str[i]=='E') y++; else if(str[i]=='W') y--; } cout << sqrt(x*x+y*y); return 0; }