program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: r,g,b,n,ans
    integer(int32):: ri,gi,bi

    read*, r,g,b,n
    ans=0
    do ri=0,n
        do gi=0,n
            bi = n-ri*r-gi*g
            ! print*, ri,gi,bi
            if (mod(bi,b)==0 .and. bi >= 0)then
                ans=ans+1
            end if
        end do
    end do

    print*, ans
end program name