Cover a set with multiples Lets take a set of integers greater than 1 and call it X.  We will define S(i) to be the set of all members of X divisible by i where i > 1.   Would like to choose from these subsets a group of sets such that


Their union is the set X
No element of X is in two of the sets.


For example we can regroup {3..11} as 

      {3,4,5,6,7,8,9,10,11}
S(3): {3,    6,    9,     }
S(4): {  4,      8,       }
S(5): {    5,        10,  }
S(7): {        7,         }
S(11):{                 11}


Some sets cannot be expressed in this way.  For example if we take {3..12}, 12 is a multiple of both 3 and 4 preventing our sets from being mutually exclusive.

Some sets can be expressed in multiple ways, for example {4..8} can be represented as 

      {4,5,6,7,8}
S(4): {4,      8}
S(5): {  5,     }
S(6): {    6,   }
S(7): {      7, }


but it can also be represented as

      {4,5,6,7,8}
S(2): {4,  6,  8}
S(5): {  5,     }
S(7): {      7, }


Task

Our goal is to write a program that will take a set as input and output the smallest number of subsets that cover it in this fashion.  If there are none you should output some value other than a positive integer (for example 0).

This is a code-golf question so answers will be scored in bytes, with less  bytes being better.

Tests

{3..11}       -&gt; 5
{4..8}        -&gt; 3
{22,24,26,30} -&gt; 1
{5}           -&gt; 1
Python 2, 167 bytes



lambda a:([q for q in range(a[-1])if a in[sorted(sum(j,[]))for j in combinations([[p for p in a if p%i&lt;1]for i in range(2,1+a[-1])],q)]]+[0])[0]
from itertools import*


Try it online!

-9 bytes thanks to Zacharý
-4 bytes thanks to Mr. Xcoder
-2 bytes by using lists instead of sets
-5 bytes by using a in [...] rather than any([a == ...]).
-2 bytes thanks to Mr. Xcoder
-8 bytes by merging statements
-5 bytes thanks to Mr. Xcoder
-7 bytes thanks to Mr. Xcoder / Zacharý
+7 bytes to fix bug
-1 byte thanks to ovs  

note

This is extremely slow for larger maximum numbers because it is in no way optimized; it did not within 2 minutes on Mr. Xcoder's device for [22, 24, 26, 30].