import math S=input() N=S.count("N") E=S.count("E") W=S.count("W") S=S.count("S") X=abs(E-W) Y=abs(N-S) print(math.sqrt(X**2+Y**2))