array = gets.chomp.split.map(&:to_i)
if array[0] < array[1]
  until array[0] == array[1]
    array[0] += 1
    array[1] -= 1
  end
else
  until array[0] == array[1]
    array[1] += 1
    array[0] -= 1
  end
end
puts array[0]
