n = int(input()) ans = 1 while ans <= n: ans *= 2 ans //= 2 print(ans)