S=input() A=0 B=0 for s in S: if s=="N": A+=1 elif s=="S": A-=1 elif s=="E": B+=1 else: B-=1 print((A*A+B*B)**(1/2))