S=input() X=Y=0 for s in S: if s=="N": Y+=1 elif s=="E": X+=1 elif s=="W": X-=1 else: Y-=1 print((X*X+Y*Y)**0.5)