module global_variables
end module global_variables
program main
  use global_variables
  implicit none
  integer a,b,c,x,res
  integer i,j,k
  read *, a,b,c,x
  res = 0
  do i=a,0,-1
    do j=b,0,-1
      do k=c,0,-1
        if (i*500 + j*100 + k*50 == x) then
          res = res + 1
        endif
      enddo
    enddo
  enddo
  print '(i0)', res
end program main
