N = int(input()) print(1 << (N.bit_length()-1))