#N=gets.to_i
#S=gets.chomp
#A=(0...N).map{gets.to_i}
#sum=A.inject(&:+)
#B=gets.split.map(&:to_i)

R,G,B,N=gets.split.map(&:to_i)

X,Y,Z=[R,G,B].sort

count=0


xs=0
while xs<=N
  ys=0
  while ys+xs<=N
    count+=1 if (N-(ys+xs))%Z==0
    ys+=Y
  end
  xs+=X
end


puts count