program coins
	implicit none
    integer :: a,b,c,x
    integer :: a5,i,j,k,Total
    integer :: num
    
    read(*,*) a
    read(*,*) b
    read(*,*) c
    read(*,*) x
    
    num=0
    
	do i=0,a
    	do j=0,b
        	do k=0,c
            	Total=i*500+j*100+k*50
                if(Total.eq.x) then
                	num=num+1
                endif
            end do
        end do
    end do
    
    write(*,'(i0)') num

end program coins