d={'N':1,'E':1,'W':-1,'S':-1} s=input() x=y=0 for i in s: if i in 'NS': y+=d[i] else: x+=d[i] print((x**2+y**2)**.5)