This is an extremely tedious problem to do withinclusion/exclusion!

It is easy to do with generating functions.

I will start you off withinclusion/exclusion.

The number of ways for condition a to happen is .

The number of ways for conditions c to happen is .

The number of ways for conditions a & c to happen together is .

Now to finish you have to figure for each of the other conditions in all possible combinations.

With generating functions we expand .

The coefficient of will be the answer.