s=input();a=b=0 for i in s: if i=='N': a+=1 elif i=='S': a-=1 elif i=='E': b+=1 else: b-=1 print((a**2+b**2)**.5)