implicit none
integer:: x,a,b,c,count,i,j,k
read(5,*) a,b,c,x
count=0
 
do i=0,a
do j=0,b
do k=0,c
    if (x==500*i+100*j+50*k) then
        count=count+1
    endif
enddo
enddo
enddo

write(6,*) count
 
end