x, y = 0, 0 for c in input(): if c == 'N': y += 1 elif c == 'S': y -= 1 elif c == 'E': x += 1 else: x -= 1 print((x * x + y * y) ** 0.5)