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(); static void Main() { var c = NList; var (a, b) = (c[0], c[1]); WriteLine(XorMin(a, b)); } static int XorMin(int a, int b) { var large = Math.Max(a, b); var mul = 1; while (mul * 2 <= large) mul *= 2; return Math.Min(mul - 1, Math.Min(a, b)); } }