S = list(input()) now = [0,0] for s in S: if s=="N": now[0]+=1 elif s=="S": now[0]-=1 elif s=="E": now[1]+=1 else: now[1]-=1 a = now[0]**2+now[1]**2 print(a**(1/2))