n = int(input()) i = 0 while n != 0: n >>= 1 i += 1 print(1 << (i - 1))