x=y=0 for c in input(): if c=="N":y+=1 if c=="S":y-=1 if c=="E":x+=1 if c=="W":x-=1 print((x**2+y**2)**0.5)