st = input() n = st.count("N") s = st.count("S") e = st.count("E") w = st.count("W") import math print(math.sqrt((n-s)**2+(e-w)**2))