n = int(input()) k = 1 << 59 while n & k == 0: k >>= 1 print(k)