There are 17 dogs, 34 chickens and 68 spiders.

If there were D dogs, we would have 2D chickens. Which means we have 2 x 2D = 4D spiders.

How many legs would we have?

D dogs have 4D legs.

2D chickens have 4D legs.

4D spiders have 32D legs.

So in total we have 4D + 4D + 32D = 40D legs.

We know that we have 680 legs in total, so 40D = 680.

Divivde both sides by 40 gives D = 17. Which means there are 34 chickens and 68 spiders. QED.