
fun main(args: Array<String>?): Unit {
    while (true) {
        val (x, y) = readLine()?.trim()?.split(' ')?.map{Math.abs(it.toInt())}?.sorted() ?: return
        println(if (x != 0) (x / 2 * 2) + (y / 2 * 2) + Math.max(x % 2, y % 2) else if (y != 1) y + y % 2 else 1)
    }
}
