program main
   implicit none
   integer:: r(3),n,i,j,k,counter=0,a(3)
   read(*,*)r,n
   a(1)=maxval(r)
   a(3)=minval(r)
   r(maxloc(r))=0
   a(2)=maxval(r)

   do i=0,n
      
      do j=0,n
         if(n-a(2)*j-a(3)*i>=0.and. mod(n-a(2)*j-a(3)*i,a(1))==0)counter=counter+1
      ENDDO
   enddo
   write(*,*)counter
end program main
