fun main(args:Array<String>) {
    val abc = (1..3).map { readLine()!!.toInt() }
    val x = readLine()!!.toInt()
    val ans = getAns(0, abc, x)
    println(ans)
}


fun getAns(index:Int, coins:List<Int>, remain:Int):Long {
    if(remain == 0) {
        return 1
    }
    if(remain < 0) {
        return 0
    }
    if(index >= coins.size) {
        return 0
    }
    val coinKind = listOf(500,100,50)
    var ret = 0L
    for(i in (0..coins[index])) {
        val subList = mutableListOf<Int>()
        subList.addAll(coins)
        subList[index] -= i
        ret += getAns(index + 1, subList, remain - (coinKind[index]*i) )
    }
    return ret
}