n = int(eval(input()))

if n == 1:

    print((1))

else:

    times = []

    for i in range(2, n + 1, 2):

        t = 0

        while i % 2 == 0:

            i //= 2

            t += 1

        else:

            times.append(t)

    else:

        print(((times.index(max(times)) + 1) * 2))
n = int(eval(input()))



max_t = 0

ans = 1



for i in range(2, n + 1, 2):

    t = 0

    j = i

    while j % 2 == 0:

        j //= 2

        t += 1

    else:

        if max_t < t:

            max_t = t

            ans = i

else:

    print(ans)
n = int(eval(input()))
if n == 1:
    print((1))
else:
    times = []
    for i in range(2, n + 1, 2):
        t = 0
        while i % 2 == 0:
            i //= 2
            t += 1
        else:
            times.append(t)
    else:
        print(((times.index(max(times)) + 1) * 2))

n = int(eval(input()))
max_t = 0
ans = 1
for i in range(2, n + 1, 2):
    t = 0
    j = i
    while j % 2 == 0:
        j //= 2
        t += 1
    else:
        if max_t < t:
            max_t = t
            ans = i
else:
    print(ans)

-if n == 1: -    print((1)) +max_t = 0 +ans = 1 +for i in range(2, n + 1, 2): +    t = 0 +    j = i +    while j % 2 == 0: +        j //= 2 +        t += 1 +    else: +        if max_t < t: +            max_t = t +            ans = i -    times = [] -    for i in range(2, n + 1, 2): -        t = 0 -        while i % 2 == 0: -            i //= 2 -            t += 1 -        else: -            times.append(t) -    else: -        print(((times.index(max(times)) + 1) * 2)) +    print(ans)