r,g,b,n = gets.split.map(&:to_i)
box = [r,g,b]
ans = 0
check = [0,0]
while box[0]*check[0] <= n
  while box[0]*check[0]+box[1]*check[1] <= n
    ans += 1 if (n - (box[0]*check[0]+box[1]*check[1]))%box[2] == 0
    check[1] += 1
  end
  check[0] += 1
  check[1] = 0
end
puts ans
