integer R,G,B,N
integer aka,midori,ao
integer ans
read*,R,G,B,N

ans=0
aka=0
do while(aka*R<=N)
  midori=0
  do while(aka*R+midori*G<=N)
    if(mod(N-aka*R-midori*G,B)==0)ans=ans+1
    midori=midori+1
  end do
  aka=aka+1
end do
print"(I0)",ans
end