using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Myon { static void Main() { string[] ss; ss = Console.ReadLine().Split(' '); long x = long.Parse(ss[0]); long y = long.Parse(ss[1]); ss = Console.ReadLine().Split(' '); long xx = long.Parse(ss[0]); long yy = long.Parse(ss[1]); long ans; if(xx==yy && x==y && xx < x) { ans = x + 1; } else { ans = Math.Max(x, y); } Console.WriteLine(ans); } }