using System; class P { static void Main() { int N = Convert.ToInt32(Math.Pow(2, p() - 1)); int X = p(); int A = (X / p()) + 1; int B = ((N - 1 - X) / p()) + 1; Console.WriteLine(Math.Min(A,B)); Console.ReadLine(); } static int p() => int.Parse(Console.ReadLine()); }