x, y, d = gets.split.map(&:to_i) m = x + y res = d + 1 res -= d - x if x < d res -= d - y if y < d if res >= 0 puts res else puts 0 end