#include #include #include int main(void){ double ns=0,ew=0; int i,l; char s[128]; scanf("%s",s); l = strlen(s); for(i = 0;i < l;i++){ if(s[i] == 'N'){ns = ns + 1;} if(s[i] == 'S'){ns = ns - 1;} if(s[i] == 'E'){ew = ew + 1;} if(s[i] == 'W'){ew = ew - 1;} } ns = sqrt(ns*ns+ew*ew); printf("%.20lf",ns); return 0; }