#include using namespace std; //-------------------------------------------- #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) RFOR(i,0,n) #define LL long long #define INF INT_MAX/3 //-------------------------------------------- const double EPS = 1e-14; const double PI = acos(-1.0); //-------------------------------------------- int main(){ double x = 0; double y = 0; char s[110]; scanf("%s",s); REP (i,110) { if (s[i] == 'N') y = y + 1; else if (s[i] == 'S') y = y - 1; else if (s[i] == 'E') x = x + 1; else if (s[i] == 'W') x = x - 1; } printf("%lf\n",sqrt((x * x) + (y * y))); }