S = input() a = S.count("N") - S.count("S") b = S.count("E") - S.count("W") print((a * a + b * b) ** 0.5)