d1 = dict(zip("NEWS",[1,0,0,-1])) d2 = dict(zip("NEWS",[0,1,-1,0])) x = y = 0 for i in input(): x += d1[i] y += d2[i] print((x*x+y*y)**0.5)