l ={"N":0,"E":0,"W":0,"S":0} for i in input(): l[i] += 1 print(((l["N"]-l["S"])**2 + (l["E"]-l["W"])**2)**0.5)