program tenquestionfour
 implicit none
 integer A, B, C, X, i, j, k, res
 read(*,*) A
 read(*,*) B
 read(*,*) C
 read(*,*) X
 ! read(*,*) A, B, C, X でよい
 res = 0
 do i=0,A
  do j=0,B
   do k=0,C
   if((500*i + 100*j + 50*k).eq.X) res = res + 1
   if ((500*i + 100*j + 50*k).gt.x) exit 
   end do
   if ((500*i + 100*j).gt.x) exit
  end do
  if ((500*i).gt.x) exit
 end do
 write(*,*) res
end program