fun main(args: Array<String>) {
    val five_yen = readLine()!!.toInt()
    val one_hund = readLine()!!.toInt()
    val fifty = readLine()!!.toInt()
    val ans = readLine()!!.toInt()
    var con = 0

    for(i in 0..five_yen){
        for(n in 0..one_hund){
            for(y in 0..fifty){
                if(500 * i + 100*n + 50 * y == ans){
                    con++
                }
            }
        }
        
    }
    println(con)

}