s=input();x,y=0,0 for a in s: x=x+(a=='E')-(a=='W') y=y+(a=='N')-(a=='S') print((x**2+y**2)**.5)