#!/bin/bash
 
read amax
read bmax
read cmax
read x
 
sum=0
for a in $(seq 0 ${amax}) ; do
    for b in $(seq 0 ${bmax}) ; do 
        for c in $(seq 0 ${cmax}) ; do
            if ((a * 500 + b * 100 + c * 50 == x)) ; then
                let sum++
            fi
        done
    done
done
echo ${sum}