a=(`cat|xargs`);s=0
for i in `seq 0 ${a[0]}`; do
	for j in `seq 0 ${a[1]}`; do
		x=$[${a[3]} - 500 * ${a[0]} - 100 * ${a[1]}]
		[ 0 -ge $x -a $x -le $[50*${a[2]}] -a $[x%50] -eq 0 ] && s=$[s+1];
	done;
done
echo $s