    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 = coin50 ,j = coin100 ,k = coin500;
        end:
        for(var i = 0; i <= coin500; i++){
            for(var j = 0; j <= coin100; j++){
                for(var k = 0; k < coin500; k++){
                    if(i * 500 + j * 100 + k * 50 === goal){
                        count++;
                    }
                }   
            }
        }
        console.log(count);
    }
    main(require('fs').readFileSync('/dev/stdin','utf-8'));