Two men will see three hats of the same colour, and one hat of a different colour. Since they know that there cannot be four hats of the same colour, they can deduce that their hat colour is the same as that of the man with the different coloured hat. So two people will know their hat colour. The other three people will see two black and two white hats and so they won’t be able to know the colour of their own hats.