require 'set'

R, G, B, N = gets.split.map &:to_i


def dp(r, g, b, n, ans = Set.new, visited = Set.new)
    return ans.add([r,g,b]) if n == 0
    return nil if ans.include?([r, g, b]) || visited.include?([r, g, b])
    return nil if n < 0
    visited.add([r, g, b])
    dp(r + 1, g, b, n - R, ans, visited)
    dp(r, g + 1, b, n - G, ans, visited)
    dp(r, g, b + (n / B), n - B * ( n / B), ans, visited)
    return ans.size
end

def valid?(r, g, b)
    return (r * R + g * G + b * B == N)
end

def over?(r, g, b)
    return (r * R + g * G + b * B > N)
end

puts dp(0, 0, 0, N)