program bproblem
implicit none
integer R, G, B, N, count
integer i, j
read(*, *) R, G, B, N
count = 0
do i = 0, N/R+1
    do j = 0, N/G+1
        if (R*i + G*j <= N) then
            if (mod((N-R*i-G*j), B) == 0) then
                count = count + 1
            end if
        end if
    end do
end do
write(*, *) count
stop
end program bproblem