s=list(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((x**2+y**2)**0.5)