
input=gets.split(" ")
n=input[0].to_i
s=input[1].to_i
i=0

number=(0..9).to_a

combi=number.combination(n).to_a


for x in 0..combi.size-1
	if combi[x].inject(0){|result,item| result + item} == s
		i += 1
	end
end

puts i