program main
Implicit None
	integer(8)::r,g,b,n,k,i,j,p,q
	
	read*,r,g,b,n
	k = 0
	
	do i = n/r,0,-1
		p = n - i*r
		if(p == 0)then
			k = k+1
			cycle
		endif
		do j = p/g,0,-1
			q = p - j*g
			if(mod(q,b) == 0) k = k+1
		enddo
	enddo
	
	print"(i0)",k
end program main