def main(): N = int(input()) binary_N = format(N, "0b") print(int("1" + "0" * (len(binary_N) - 1), base=2)) if __name__ == "__main__": main()