import math s = input() N, E, W, S = [0, 0, 0, 0] for c in s: if (c == 'N'): N += 1 elif (c == 'E'): E += 1 elif (c == 'W'): W -= 1 else: S -= 1 x = E + W y = N + S r = math.sqrt(x**2 + y**2) print(r)