Coloured Hats

Kelly is wearing a red hat.  If she had a blue one on, then since there is only one blue hat, Dan would have known that his was red.