using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var n = long.Parse(ReadLine()); var ans = 1L; while (ans * 2 <= n) { ans <<= 1; } WriteLine(ans); } }