Added 17 minutes later
In a certain kingdom, in a certain state, there lived a king. And he had 100 wise men. One day, the king decided to check how wise his wise men really were. He summoned them to him and said: "Tomorrow, you will be led to the square, lined up, and each of you will be given a red, white, or blue hat, and then the executioner will be called. After that, I will call each of you one by one, and each of you must say what color hat is on your head. Those who guess the wrong color of the hat on their head will have their head cut off!"
The wise men began to think about how to save themselves.
First, they came up with a way to save every other one. For this, he must say the color of the hat of the wise man behind him, and every second wise man must repeat what the one called before him said.
Then they came up with a way to save two out of three. The first wise man looks at the hats of the second and third. If they are the same color, he says that color, and if they are different, he says the color that is not on either the second or the third wise man. The second one comes out and, if he sees that the third one has the same color hat as the first one said, he says that color, and if it's a different color, he says the third color - neither the one the first one said nor the one the third one has. The third one, if the first and second said the same color, says that color, and if they said different colors, he says the remaining color. This way, 66 wise men can be guaranteed to be saved.
Question: what is the maximum number of wise men that can be guaranteed to be saved, and how? Or, if there is no way to guarantee saving more than 66 wise men, prove why!