s=input() C=lambda m:s.count(m) x,y=C("E"),C("N") x-=C("W") y-=C("S") print((x*x+y*y)**0.5)