The 500 hats of Bartholomew Cubbins