object Main {
  def readLine(): String = scala.io.StdIn.readLine()
  def readLines(n: Int): Seq[String] = List.fill(n)(readLine())
  def readLinesTo(end: String, ss: Seq[String] = Nil): Seq[String] = readLine() match {
    case s if s.trim == end => ss
    case s => readLinesTo(end, ss :+ s)
  }

  def main(args: Array[String]): Unit = {
    case class Ns(string: String) {
      val Array(n, s) = string.split(" ").map(_.toInt)
      val result: Int = {
        0.to(s - 0.to(s).take(n - 1).sum).combinations(n).count(_.sum == s)
      }
    }
    readLinesTo("0 0").foreach(l => println(Ns(l).result))
  }
}