ns,we=[0,0] for i in input(): if i in 'NS': ns += [1,-1][i=='S'] else: we += [1,-1][i=='E'] print((abs(ns)**2+abs(we)**2)**(1/2))