fun main(args: Array<String>){
    val _500Coins = readLine()!!.toInt()
    val _100Coins = readLine()!!.toInt()
    val _50Coins = readLine()!!.toInt()
    val x = readLine()!!.toInt()
    var result = 0

    for(i in 0.._500Coins){
        for(j in 0.._100Coins){
            for(k in 0.._50Coins){
                val sum = 500 * i + 100 * j + 50 * k
                if(sum == x) result++
            }
        }
    }

    print(result)
}
