1. Solve the problem: octopuses with an even number of legs always lie, while octopuses with an odd number of legs always tell the truth. Five octopuses met, each having between 7 and 9 legs.

The first said: "We have 36 legs in total";

The second: "We have 37 legs in total";

The third: "We have 38 legs in total";

The fourth: "We have 39 legs in total";

The fifth: "We have 40 legs in total".

How many legs did they actually have?
Solution. All answers are different, so one is telling the truth or all are lying. If all were lying, they would have 8 legs, i.e., a total of 40, which matches the last answer, a contradiction.

Therefore, four are lying, one is telling the truth, and the one telling the truth has an odd number of legs since $4 \cdot 8 = 32$, the truthful octopus can only have 7 legs, otherwise, there would be no correct answer. Thus, the fourth octopus with seven legs is telling the truth, and the others are liars with 8 legs.

Answer: 39 legs.