program main
 implicit none

 integer*8 R,G,B,N,N1,N2,i,j,k,l,cnt

 read(*,*) R,G,B,N

 k = N / R
 do i=0,k
  N1 = N - k*R
  l = N1 / G
  do j=0,l
   N2 = N1 - j*G
   if(mod(N2,B) == 0) then
    cnt = cnt + 1
   end if
  end do
 end do

 write(*,*) cnt
end program main