#include #include int main(void){ int x = 0, y = 0; char h; while(1){ h = getchar(); if(h=='N'){ y++; }else if(h=='E'){ x++; }else if(h=='W'){ x--; }else if(h=='S'){ y--; }else{ printf("%.5lf\n", sqrt(x*x + y*y)); return 0; } } }