How many classes of solutions are there to

So I did this:

1. Let a be the number of the classes of solutions to

2. Let b be the number of the classes of solutions to

3. Let c be the number of the classes of solutions to

So the classes of solutions to is equal to

For case 1. We have as congruence classes and only and works so that's 4 classes of solutions.

For case 2. We have as congruence classes and only works so that's 2 classes of solutions.

For case 3. We have as congruence classes and only works so that's 2 classes of solutions.

So all together we have classes of solutions.

However what I'm wondering is, isn't this way a bit primitive because if I worked out the PPF of some number other than 168 and ended up with say as one of the prime powers, then I would have to work out the number of classes of solutions to Which means I have to list out then test each of them to see if they work, wouldn't that take ages? Is there a faster way other than plugging a solution from each class of solutions into the equation and seeing if it works?

Thanks.