a,b,c = gets.split.map(&:to_i) # 入力が複数の場合 red = a blue = b white = c purple = 0 (1..white).each do |a| if red >= blue blue += 1 else red += 1 end end if red >= blue purple = blue else purple = red end puts purple