There are 100 prisoners in line. Each one is randomly placed with a red or blue hat.
Each prisoner can see the hats of everyone in front of him, but not his own or those behind him. Starting with the last person in the line and moving forward, each person must say a single word out loud: “red” or “blue.” They can't say anything else.
If someone guesses the color of his hat correctly, he survives; If you fail, you die. Before starting you can agree on a strategy.
What is the best possible strategy and how many lives does it guarantee?