f=lambda y:x/y and f(y*2)or y while 1:x=input();print f(1)