We find the formula for the cardinality of maximal set of integers from $[1,\ldots,n]$ which does not contain $k+1$ pairwise coprimes and has divisors from a specified set of primes. This formula is defined by the set of multiples of the generating set, which does not depend on $n$.