Kuba agreed with the shepherd that he would take care of the sheep. The shepherd promised Kuba that after a year of service, he would get twenty gold coins and one sheep. But Kuba quit just when seven months of service had passed. Even so, the shepherd fairly rewarded him and paid him five gold coins and one sheep.

How many gold coins did the shepherd value one sheep at?

(L. Hozová)

Hint. How many gold coins did the shepherd value Kuba's monthly work at?
Kubovi had 5 months left until the end of the year and received 15 gold coins less than he would have received for a full year of service. This means that if he had been paid only in cash, he would have received 3 gold coins per month $(15: 5=3)$.

For 7 months, Kuba should have received 21 gold coins $(7 \cdot 3=21)$. However, he received 5 gold coins and one sheep, so the sheep must be worth 16 gold coins $(21-5=16)$.

Another hint. What could a fair reward for seven years of service look like?

Another solution. We have two ways to express the same reward:

- 20 gold coins and 1 sheep for 12 months,
- 5 gold coins and 1 sheep for 7 months.

If we convert these expressions to the same time period, we can determine the value of the sheep. The reward for seven years (i.e., $7 \cdot 12$ months) of service can be expressed in two ways:

- 140 gold coins and 7 sheep (i.e., seven times the first option),
- 60 gold coins and 12 sheep (i.e., twelve times the second option).

In the first case, the reward is 80 gold coins more and 5 sheep less than in the second. Thus, 5 sheep are worth 80 gold coins, and one sheep is worth 16 gold coins $(80: 5=16)$.

Note. If we denote gold coins by $z$ and the price of a sheep by $o$, the information from the problem can be written as:

$$
5 z+o=\frac{7}{12}(20 z+o) .
$$

From this, $o$ can be expressed in terms of $z$ in various ways. The reasoning from the previous solution can be summarized as follows:

$$
\begin{aligned}
12(5 z+o) & =7(20 z+o) \\
60 z+12 o & =140 z+7 o, \\
5 o & =80 z \\
o & =16 z .
\end{aligned}
$$

It is not immediately clear from the problem statement that the price of the sheep in gold coins is an integer. With this additional assumption, the solution can be found by systematically trying different possibilities.