fun main(args: Array<String>) {
    val a = readLine()?.toInt() ?: return
    val b = readLine()?.toInt() ?: return
    val c = readLine()?.toInt() ?: return
    val x = readLine()?.toInt() ?: return

    val count = 0.until(a + 1).map { it * 500 }.map { i ->
        0.until(b + 1).map { it * 100 }.map { j ->
            0.until(c + 1).map { it * 50 }.map { k ->
                i + j + k == x
            }
        }.flatten()
    }.flatten().count { it }

    println(count.toString())
}
