def resolve():

    N = int(eval(input()))

    for i in range(1,9):

        if 2**i > N:

            ans = 2**(i-1)

            break

    print(ans)

resolve()

#!/usr/bin/env python3



def main():

    n = int(eval(input()))

    i = 0

    while 2 ** i <= n:

        i += 1

    print((2 ** (i - 1)))





if __name__ == "__main__":

    main()

def resolve():
    N = int(eval(input()))
    for i in range(1, 9):
        if 2**i > N:
            ans = 2 ** (i - 1)
            break
    print(ans)


resolve()

#!/usr/bin/env python3
def main():
    n = int(eval(input()))
    i = 0
    while 2**i <= n:
        i += 1
    print((2 ** (i - 1)))


if __name__ == "__main__":
    main()

-def resolve(): -    N = int(eval(input())) -    for i in range(1, 9): -        if 2**i > N: -            ans = 2 ** (i - 1) -            break -    print(ans) +#!/usr/bin/env python3 +def main(): +    n = int(eval(input())) +    i = 0 +    while 2**i <= n: +        i += 1 +    print((2 ** (i - 1))) -resolve() +if __name__ == "__main__": +    main()