Edit the given code segment in Python and make it a valid program:
x = 5
def add_two_numbers(x, y):
    z = x + y
    return z
x = 5
def add_two_numbers(x, y):
    z = x + y
    return z

result = add_two_numbers(x, 5)
print(result)