#!/bin/bash

read a
read b
read c
read x

ans=0
for (( i_c = 0; i_c <= c; i_c++ ))
do
    for (( i_b = 0; i_b <= b; i_b++ ))
    do
        for (( i_a = 0; i_a <= a; i_a++ ))
        do
            total=$((i_a * 500 + i_b * 100 + i_c * 50))
            if [ $total -eq $x ];then
                ans=$((ans + 1))
            fi
        done
    done
done
echo $ans