one_twenty = (1..20).to_a
table = Array.new(156){[]}
1.upto(20){|k|
	one_twenty.combination(k){|arr|
		sum = arr.inject(:+)
		table[sum] << [arr.max, k] if sum < 156
	}
}
until (line = gets.chomp) == "0 0 0"
	n, k, s = line.split.map(&:to_i)
	puts table[s].count{|a, b| a <= n && b == k}
end
