N = int(input()) for i in reversed(range(60)): if N & (1 << i): ans = 1 << i print(ans) break