import math s=input() a=0 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(math.sqrt(a**2+b**2))