using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Numerics; using System.Text; //using static CompLib.CompLib; //using DataStructure; namespace atcoder { class Program { const int intMax = 1000000000; const long longMax = 2000000000000000000; static void Main(string[] args) { var AB = Console.ReadLine().Trim().Split().Select(int.Parse).ToArray(); int A = AB[0]; int B = AB[1]; if (A > B) { int temp = A; A = B; B = temp; } var binA = Convert.ToString(A, 2); var binB = Convert.ToString(B, 2); if (binA.Length < binB.Length) { Console.WriteLine(A); } else { Console.WriteLine(Math.Pow(2, binA.Length - 1) - 1); } } } }