import scala.io.StdIn._
import scala.annotation.tailrec

object Main extends App {
  val Array(n, k) = readLine().split(" ").map(_.toInt)

  def combinations(i: Int): Int = {
    (0 to n).combinations(i).map(_.sum).toSeq.distinct.length
  }

  println((for {
    i <- k to n + 1
  } yield {
    combinations(i)
  }).sum)
}
