program ABC087B
    implicit none
    integer(8)::i,j,k
    integer(8)::A,B,C,X
    integer(8)::result=0
    read(5,*)A,B,C,X

    do i=0,A
        do j=0,B
            do k=0,C
                if(i*500+j*100+k*50==X)then
                    result=result+1
                end if
            end do
        end do
    end do
    print'(i0)',result
end program ABC087B