N = raw_input() N,E,W,S = N.count("N"),N.count("E"),N.count("W"),N.count("S") print ((N-S)**2+(E-W)**2)**(1./2)