object Main extends App {
  val amount = Array(500,100,50)
  val in = Iterator.continually(io.StdIn.readLine.toInt)
    .take(4).toArray

  val ans = {
      for {
        i <- 0 to in(0)
        if amount(0)*i <= in(3)
        j <- 0 to in(1)
        if amount(1)*j <= in(3)
        k <- 0 to in(2)
        if amount(0)*i + amount(1)*j + amount(2)*k == in(3)
      } yield  true
    }.size

  println(ans)
}