N = int(input()) b = bin(N)[2:] print(2**(len(b)-1))