L = list(input()) N = L.count("N") E = L.count("E") W = L.count("W") S = L.count("S") A = abs(N-S) B = abs(W-E) print((A**2+B**2)**(1/2))