n=int(input()) a=1 while n>1: n//=2 a*=2 print(a)