"""

"""

import sys
from sys import stdin

N = int(stdin.readline())

print (2**(N.bit_length()-1))