#include #define rep(i,n)for(long long i=0;i<(n);i++) using namespace std; typedef unsigned long long ull; typedef long long ll; const ll INF=1e18; const int MOD=1e9+7; const double pi=acos(-1); int main(){ double t=0,y=0; string s; cin >> s; rep(i,s.size()){ if(s[i]=='N')t++; if(s[i]=='S')t--; if(s[i]=='E')y++; if(s[i]=='W')y--; } cout << fixed << setprecision(10) << sqrt(t*t+y*y) << endl; }