import math d = input() n = 0 e = 0 w = 0 s = 0 for i in d: if i == "N": n += 1 elif i == "E": e += 1 elif i == "W": w += 1 else: s += 1 print(math.sqrt(abs(n-s)**2 + abs(w-EOFError)**2))