def sum_of_multiples(limit, multiples):
    result = []
    for i in range(limit):
        for j in multiples:
            if j != 0 and i % j == 0:
                result.append(i)
    return sum(set(result))





