Crows are smart cookies. They can grasp analogies, use tools, and have bested human children in intelligence tests. They’re also decent at counting. 

Birds show an ability to keep track of numbers even without the parts of the brain that primates use to count. So how do they do it? A new study in the journal PNAS finds that even though birds and primates evolved with different brain structures, they developed similar neural processes to deal with quantification. 

Mammal brains feature a six-layered neocortex, a thin structure surrounding the brain which scientists think is involved in higher-level cognition. Birds and reptiles, by contrast, don’t have a neocortex. But, even though crows don’t have the brain structure that mammals like chimps and humans use to keep track of numbers, they somehow accomplish similar tasks. They do this using the nidopallium caudolaterale, a front part of the bird brain that’s comparable to (but not exactly like) a human’s prefrontal cortex.

Researchers from the Institute of Neurobiology in Tübingen, Germany, trained two crows to count, having them identify images with the same number of dots on a screen. They then recorded the crows’ brain activity during the task, checking in on 499 random neurons. About 20 percent of them fired during the tests. 

Certain neurons in the nidopallium caudolaterale needed to fire for the crows to count correctly. The researchers write that “if the neurons did not properly encode their preferred numerosity, the crow was prone to make mistakes.” These neurons contributed to “high-level, abstract visual representations” of numbers that allowed the crows to count properly. Essentially, the chemical codes that allow the brain to count looked similar to those seen in primates—but the structures were different. 

Determining how the brains of birds work helps scientists understand evolution. Similarities between the functions of mammal and bird brains could indicate that certain abilities evolved in a common ancestor, or that particular ways of coding information came about independently in different species.