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