import sys input=lambda: sys.stdin.readline().rstrip() S=input() x,y=0,0 for s in S: if s=="E": x+=1 if s=="W": x-=1 if s=="N": y+=1 if s=="S": y-=1 print((x**2+y**2)**0.5)