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