R, G, B, N = gets.split.map &:to_i
ans = 0
(0..3000).each{|r|
  rr = r * R
  break if rr > N
  (0..3000).each{|g|
    rrgg = rr + g * G
    break if rrgg > N
    ans += 1 if (N - rrgg) % B == 0
  }
}
p ans