R, G, B, N = gets.strip.split(/ /).collect(&:to_i)

$cache = []
def countGB(n)
	if count = $cache[n]
		return count
	end
	x = 0
	count = 0
	while x <= n
		if (n - x) % B == 0
			count += 1
		end
		x += G
	end
	
	$cache[n] = count
end

x = 0
count = 0
while x <= N
	count += countGB(N - x)
	x += R
end

puts count

