$R, $G, $B, $N = gets.split.map(&:to_i)
count = 0
(0..$N).each do |r|
  (0..$N).each do |g|
    b = ($N - $R * r - $G * g).to_f / $B
    if 0 <= b && b.ceil == b.to_i
      count += 1
    else
      break
    end
  end
end
puts count