# import bisect

# import copy

# import fractions

# import math

# import numpy as np

# from collections import Counter, deque

# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product



def resolve():

    N=int(eval(input()))

    val=1

    while val<=N:

        val=val*2

    print((val//2))



resolve()
import sys

sys.setrecursionlimit(10 ** 5 + 10)

def input(): return sys.stdin.readline().strip()



def resolve():



    N=int(eval(input()))

    i=1

    while i<=N:

        i*=2

    print((i//2))



resolve()
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product
def resolve():
    N = int(eval(input()))
    val = 1
    while val <= N:
        val = val * 2
    print((val // 2))


resolve()

import sys

sys.setrecursionlimit(10**5 + 10)


def input():
    return sys.stdin.readline().strip()


def resolve():
    N = int(eval(input()))
    i = 1
    while i <= N:
        i *= 2
    print((i // 2))


resolve()

-# import bisect -# import copy -# import fractions -# import math -# import numpy as np -# from collections import Counter, deque -# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product +import sys + +sys.setrecursionlimit(10**5 + 10) + + +def input(): +    return sys.stdin.readline().strip() + + -    val = 1 -    while val <= N: -        val = val * 2 -    print((val // 2)) +    i = 1 +    while i <= N: +        i *= 2 +    print((i // 2))