a=b=0 for s in input():t,u={'N':[1,0],'E':[0,1],'W':[0,-1],'S':[-1,0]}[s];a+=t;b+=u print((a*a+b*b)**0.5)