dic = {"N": (0, 1), "E": (1, 0), "S": (0, -1), "W": (-1, 0)} pos = [0, 0] S = input() for i in range(len(S)): dx, dy = dic[S[i]] pos[0] += dx pos[1] += dy print((pos[0] ** 2 + pos[1] ** 2) ** 0.5)