N = int(input())
k = 0
for i in range(60):
    if (N >> i) & 1:
        k = i
print(1 << k)