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