import math M = list(map(str, input())) N = M.count("N") S = M.count("S") E = M.count("E") W = M.count("W") SUM = (N - S) ** 2 + (E - W) ** 2 ans = math.sqrt(SUM) ans = str(ans) + "0" if ans.find(".00") == 1: ans = float(ans) print(math.ceil(ans)) else: ans = float(ans) print("{:.5f}".format(ans))