To a toy store, new stuffed animals have been delivered: dragonflies, ostriches, and crabs. Each dragonfly has 6 legs and 4 wings, each ostrich has 2 legs and 2 wings, and each crab has 8 legs and 2 claws. In total, these delivered toys have 118 legs, 22 wings, and 22 claws. How many heads do they have in total?

(M. Petrová)

Hint. Use the fact that among the mentioned animals, only crabs have claws.
For clarity, let's record the data about each toy in a table:

|  | legs | wings | claws | heads |
| :---: | :---: | :---: | :---: | :---: |
| dragonfly | 6 | 4 | 0 | 1 |
| ostrich | 2 | 2 | 0 | 1 |
| crab | 8 | 0 | 2 | 1 |

It is clear that only crabs have claws. Since there are 22 claws in total and each crab has 2 claws, there must be $22: 2=11$ crabs. These crabs have a total of $11 \cdot 8=88$ legs. Therefore, the remaining legs for dragonflies and ostriches are $118-88=30$.

Dragonflies and ostriches thus have 30 legs and 22 wings in total. To determine the number of each toy, note the following:

|  | legs | wings |
| :---: | :---: | :---: |
| one dragonfly | 6 | 4 |
| one ostrich | 2 | 2 |
| two ostriches | 4 | 4 |

We see that two ostriches have the same number of wings as one dragonfly, but they have 2 fewer legs. We can imagine that from two ostriches, we "make" one dragonfly by "adding" two more legs.

According to the wings, there are 11 ostriches $(22: 2=11)$. However, they would only have 22 legs $(11 \cdot 2=22)$. Therefore, we have 8 legs left $(30-22=8)$, which we will use to "convert ostriches into dragonflies." Each time we add 2 legs, two ostriches become one dragonfly, so there are $8: 2=4$ dragonflies.

Four dragonflies have a total of 24 legs $(4 \cdot 6=24)$ and 16 wings $(4 \cdot 4=16)$. Therefore, the remaining legs for ostriches are 6 $(30-24=6)$ and the remaining wings are 6 $(22-16=6)$. Thus, there are 3 ostriches $(6: 2=3)$. The previous reasoning can be schematically represented as follows (the symbol ì́ represents two wings and two legs, i.e., the defining features of one ostrich):

![](https://cdn.mathpix.com/cropped/2024_04_17_bf297f7f854ac26a2877g-2.jpg?height=103&width=471&top_left_y=2381&top_left_x=473)

In total, 11 crabs, 4 dragonflies, and 3 ostriches were delivered to the toy store. Since each of these animals has one head, they have 18 heads in total $(11+4+3=18)$.

Alternative solution. Similarly to the previous solution, we determine that 11 crabs were delivered and that dragonflies and ostriches have 30 legs and 22 wings in total.

Since dragonflies have 6 legs each, there can be at most 5 dragonflies, and we will examine each possibility one by one. If there were one dragonfly, there would be $30-6=24$ legs and $22-4=18$ wings left for ostriches. To match the number of legs, there would have to be 12 ostriches, but to match the number of wings, there would have to be 9 ostriches—so there cannot be one dragonfly.

We will not elaborate on the other cases, but summarize the discussion in the following table, and the conclusion is the same as above.

| dragonflies | remaining legs | remaining wings | ostriches |
| :---: | :---: | :---: | :---: |
| 1 | 24 | 18 | - |
| 2 | 18 | 14 | - |
| 3 | 12 | 10 | - |
| 4 | 6 | 6 | **3** |
| 5 | 0 | 2 | - |