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