X=Y=0 for x in input(): if x=='N':Y+=1 if x=='S':Y-=1 if x=='E':X+=1 if x=='W':X-=1 print((X**2+Y**2)**0.5)