from collections import Counter from math import hypot S = input() C = Counter(S) print(hypot(C["N"] - C["S"], C["W"] - C["E"]))