$a = 0
def f(i, n, s)
  if n == 0
    $a += 1 if $u == s
    return
  end
  return if i == 10
  f(i+1, n, s)
  f(i+1, n-1, s+i)
end

n, $u = gets.split.map(&:to_i)
exit(0) if n==0 && $u==0
f(0, n, 0)
puts $a