    fun main(args: Array<String>) {
        val input = read()
        println(coins(input))
    }

    fun read(): List<Int> {
        val readed = mutableListOf<Int>()
        readed.add(Integer.parseInt(readLine()))
        readed.add(Integer.parseInt(readLine()))
        readed.add(Integer.parseInt(readLine()))
        readed.add(Integer.parseInt(readLine()))
        return readed
    }

    fun coins(inputs: List<Int>): Int {
        val sums = mutableListOf<Int>()
        (0..inputs[0]).forEach { fiveHundred ->
            (0..inputs[1]).forEach { hundred ->
                (0..inputs[2]).forEach { fifty ->
                    sums.add(fiveHundred * 500 + hundred * 100 + fifty * 50)
                }
            }
        }
        return sums.count { it == inputs[3] }
    }