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