N = int(input()) for i in range(65, -1, -1): if (N >> i) & 1: print(1 << i) exit()