x, y, z = gets.strip.split.map(&:to_i) puts (0..z).map{|i| [x+i, y+z-i].min}.max