a, b = io.read("*n", "*n") if b < a then a, b = b, a end if b <= a + 1 then print(a + b) else print(a + b + 1 * (b - a - 1)) end