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

    var count=0
    for(ai in 0..a)for(bi in 0..b)for(ci in 0..c){
        if(500*ai+100*bi+50*ci==x) count++
    }
    println(count)
}