Bakayev E.B.

A boy and a girl were sitting on a long bench. Twenty more children approached them one by one, and each of them sat between two of the already seated children. We will call a girl brave if she sat between two neighboring boys, and a boy brave if he sat between two neighboring girls. When everyone was seated, it turned out that the boys and girls were sitting on the bench, alternating. How many of them were brave?
The first method. Let's look at the number of pairs of adjacent boys and girls. Initially, it is equal to 1. Notice that if a boy sits between two boys, the number of such pairs does not change. If he sits between a boy and a girl, he "destroys" one such pair and "creates" one, so the number of such pairs does not change. Only in the case where the boy was brave, he increases the number of such pairs by two. Similar reasoning applies to girls. Since we end up with 21 such pairs, the number of brave children was $(21-1): 2=10$.

The second method. Each brave child reduces the number of same-sex pairs by 1. Each non-brave child increases the number of same-sex pairs by 1. At the beginning, there were no same-sex pairs, and at the end, there were none either. Therefore, the number of brave children is equal to the number of non-brave children.

The third method. Groups of boys alternate with groups of girls. Initially, there were two groups. When a non-brave child sat down, he joined a group, and the number of groups did not change. When a brave child sat down, he split a group of the opposite sex into two and formed a new group consisting of himself, increasing the total number of groups by 2. In the end, there were 22 groups. Therefore, the number of brave children was (22 - 2) : $2=10$.