Prison guards are bored so during dinner they announce the prisoners that they will play a game:
In the morning they will stand in a line so that every prisoner will see all standing in front of him but no one behind him. Guards will randomly paint red or white stripe on their back.
They will ask prisoners one by one from the last to the first. They will be allowed to say just one word “red” or “white”. If the prisoner says the color he has on his back he may go home in opposite case he will be executed without delay.
The prisoners are in one cell during the night and they can discuss the tactics.
Which is the best? How many will survive?