program main
  implicit none
  integer :: i, j, k, r, g, b, n, cnt = 0
 
  read *, r, g, b, n 
  do i = 0, n
    do j = 0, n
      if (mod(n - r*i - g*j, b) == 0) cnt = cnt + 1
    end do
  end do
 
  print '(i0)', cnt
end program