import math n = int(input()) print(2 ** int(math.log2(n)))