fun main(arr: Array<String>) {
    val a = readLine()!!.toInt()
    val b = readLine()!!.toInt()
    val c = readLine()!!.toInt()
    val x = readLine()!!.toInt()

    val ans = (0..Math.min(x/500, a)).map { c500-> (0..Math.min(x/100, b)).map { x-c500*500-it*100 }.count { it >= 0 && it % 50 == 0 && it <= 50*c } }.sum()
    println(ans)
}