program coins
  implicit none
  integer :: a, b, c, x
  integer :: y, z
  integer :: i, j, m
  read(*,*) a
  read(*,*) b
  read(*,*) c
  read(*,*) x

  if (x .gt. 500*a+100*b+50*c) then
     write(*,'(i0)') 0
     stop
  end if

  m = 0
  do i = 0, a
     y = x - 500*i
     if (y .lt. 0) exit
     do j = 0, b
        z = y - 100*j
        if (z .lt. 0) exit
        if (z/50 .le. c) m = m + 1
     end do
  end do

  write(*,'(i0)') m
  
  stop
end program coins