program main
    implicit none
    INTEGER :: a, b, c, x, sum = 0, ans = 0, i, j, k
    READ(*, *) a, b, c, x
    do i = 0, a
        do j = 0, b
            do k = 0, c
                sum = 500 * i + 100 * j + 50 * k
                if(sum == x) ans = ans + 1
                sum = 0
            enddo
        enddo
    enddo
    WRITE(*, *) ans
end program main