function main(input) 
{
    input = input.split("\n").map(Number);
    var count = 0

    for (i = 0; i < input[0] + 1; i++)
    {
        for (j = 0; j < input[1] + 1; j++)
        {
            for (k = 0; k < input[2] + 1; k++)
            {
                if ((500*i+100*j+50*k) == input[3])
                {
                    count++;
                }
            }
        }
    }
    console.log(count);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
