import math s=input() x=0 y=0 for i in range(len(s)): if s[i]=="N": y+=1 elif s[i]=="S": y-=1 elif s[i]=="E": x+=1 else: x-=1 print(math.sqrt(x**2+y**2))