3. Variant 1.

On the Island of Misfortune, there live knights who always tell the truth, and liars who always lie. One day, 2022 natives gathered around a round table, and each of them made the following statement:

"I am sitting next to a knight and a liar!"

It is known that three knights made a mistake (i.e., accidentally lied). What is the maximum number of knights that could have been at the table?
Answer: 1349

## Solution.

Let's divide all the people sitting at the table into blocks consisting of natives of the same type sitting in a row. Then, blocks of liars can only consist of 1 person; otherwise, a liar sitting at the edge of this block would tell the truth. If a block of knights consists of two people, then both knights in it told the truth (did not make a mistake). If a block of knights consists of 1 person, he made a mistake in his statement (he has two neighbors who are liars). If a block of knights consists of $k>2$ people, then $k-2$ knights sitting inside the block will make a mistake (each has two knight neighbors).

Let $n$ be the number of blocks of liars, and $m \leq 3$ be the number of blocks consisting of one knight. Blocks of liars and knights alternate, so there are an equal number of each. Then, the number of knights is $m+2(n-m)+3-m=2(n-m)+3$, and the number of liars is $-n$. Therefore, $2(n-m)+3+n=2022$, or $n=\frac{2019+2 m}{3} \geq \frac{2019}{3}=673$. Then, the number of knights is no more than $2022-673=1349$.

Example. 673 blocks of liars, with one in each block, alternate with 673 blocks of knights, where one block has 5 knights, and the rest have 2 knights each.