program probB
  implicit none
  integer a,b,c,x,n
  integer i,j,k

  read(*,*) a
  read(*,*) b
  read(*,*) c
  read(*,*) x

  n=0
  do i=0,a
     do j=0,b
        do k=0,c
           if(500*i+100*j+50*k==x) n=n+1
        end do
     end do
  end do

  write(*,*) n
  
end program probB
