program test
	implicit none
    integer::a,b,c,x,i,j,k,ans
    read*,a,b,c,x
    ans=0
    do i=0,a
    	do j=0,b
        	do k=0,c
            	if(i*500+j*100+k*50==x)then
                	ans=ans+1
                end if
             end do
         end do
    end do
    print*,ans
end program test