When it comes to choosing a mate, female sparrows have shown they’re anything but bird-brained. According to new research, the feathered females don’t simply pick the most physically attractive, but instead assess the quality of their potential suitor’s inner values.

It all comes down to a cluster of genes that play a role in immunity, called the major histocompatibility complex (MHC). Researchers from the University of Veterinary Medicine in Vienna examined preferences for partners in house sparrows by offering a female sparrow a choice of three different males. They found females with a low number of MHC alleles were most attracted to males carrying a high number of such alleles, suggesting females can “count” the number of MHC alleles on offer from individual males. The evidence is the first to suggest birds’ mating preferences are influenced by the MHC.