ans = 0
A, B, C, N = gets.split.map(&:to_i)
3001.times{|a|
  next if A * a > N
  3001.times{|b|
    next if A * a + B * b > N
    rest = N - A * a - B * b
    c = rest / C
    next if c * C != rest
    ans += 1
  }
}
p ans
