from math import sqrt import sys readline=sys.stdin.readline x,y=0,0 for s in readline().rstrip(): if s=="N": x+=1 elif s=="S": x-=1 elif s=="E": y+=1 else: y-=1 ans=sqrt(x**2+y**2) print(ans)