#include #define rep(i,n) for(int i=0; i<(n); i++) using namespace std; typedef long long ll; int main(){ string d; cin>>d; int n,s,w,e; n=s=w=e=0; for(char x:d){ if(x=='N') n++; else if(x=='S') s++; else if(x=='W') w++; else if(x=='E') e++; } cout << (double)sqrt(pow(n-s,2)+pow(w-e,2)) << endl; }