s=input() x=y=0 for i in s: if i=="N": y+=1 elif i=="E": x+=1 elif i=="W": x-=1 else: y-=1 print((x**2+y**2)**.5)