program tenquestionfour
 implicit none
 integer A, B, C, X, i, j, k, res, sum
 read(*,*) A
 read(*,*) B
 read(*,*) C
 read(*,*) X
 res = 0
 sum = 0
 do i=0,A
  do j=0,B
   do k=0,C
   sum = 500*i + 100*j + 50*k
   if(sum.eq.X) then
   res = res + 1
   end if
   end do
  end do
 end do
 write(*,*) res
end program