while s = gets do
  (@n, @s) = s.split().map(&:to_i)
  @c = 0 

  def solve(n, s, x)
    if s < @s
      x.upto(9).each { |y| solve(n + 1, s + y, y + 1) }
    else
      if s == @s && n == @n
        @c += 1
      end 
    end 
  end 

  solve(0, 0, 0)
  puts @c
end