A, B = map(int, input().split()) A, B = min(A, B), max(A, B) B -= 1 ans = min(A, B) * 2 print(ans)