object Main extends App {
  val in = Iterator.continually(io.StdIn.readLine.toInt)
    .take(4).toArray

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

  println(ans.size)
}