S = input() n = 0 e = 0 for s in S: if s=="N": n+=1 elif s=="E": e+=1 elif s=="W": e-=1 else: n-=1 print((n**2+e**2)**(1/2))