A, B = gets.split.map(&:to_i) a, b = [A, B].minmax if a == b puts 2 * (b - a) + 2 * a else puts 2 * (b - a) + 2 * a - 1 end