#include #define PB push_back #define MP make_pair #define REP(i,n) for (int i=0;i<(n);i++) #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define ALL(a) (a).begin(),(a).end() using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair P; const int INF=1e9; int main(){ string s; cin>>s; int x=0,y=0; REP(i,s.size()){ if(s[i]=='S')y--; else if(s[i]=='N')y++; else if(s[i]=='E')x++; else x--; } printf("%.10f\n",sqrt(x*x+y*y)); }