#include #include #include int main(){ char str[100]; scanf("%s",str); double tate,yoko; for(int i = 0;i < (int)strlen(str);i++){ if(str[i] == 'N'){ tate++; }else if(str[i] == 'S'){ tate--; }else if(str[i] == 'E'){ yoko++; }else if(str[i] == 'W'){ yoko--; } } printf("%.20lf\n", sqrt(yoko * yoko + tate * tate)); }