    function main(input){
        const lines = input.split(/\n/);
        const coin500 = parseInt(lines[0]);
        const coin100 = parseInt(lines[1]);
        const coin50 = parseInt(lines[2]);
        const goal = parseInt(lines[3]);
        var count = 0;
        var i = 0,j = 0 ,k = 0;
        end:
        for(i = coin50; i >= 0; i--){
            for(j = coin100; j >= 0; j--){
                for(k = coin500; k >= 0; k--){
                    if(i * 50 + j * 100 + k * 500 === goal){
                        count++;
                    }
                }   
            }
        }
        console.log(count);
    }
    main(require('fs').readFileSync('/dev/stdin','utf-8'));