N = int(input()) i = 1 while(True): if(i*2>N): break i*=2 print(i)