program main
integer :: r,g,b,n,i,j,tmp,ans=0
read(*,*) r,g,b,n
do i=0,n
	do j=0,n
    	tmp = n - r*i -g*j
        if(tmp>=0 .and. mod(tmp,b)==0) then
        	ans = ans + 1
        end if
    end do
end do
write(*,*) ans
end program main