Goats are members of a diverse group of mammals called ungulates. Ungulates include barnyard favorites like cows, sheep and donkeys—all great additions at petting zoos but not known for winning any intelligence prizes in the animal kingdom.

Related Content Using Goats to Prevent Wildfires

However, ungulates also include ultra-smart species such as dolphins, whales and elephants, all of which are renowned for their keen memories and sophisticated social structures. So where do goats fall on this spectrum?

As it turns out, according to a new paper published in Frontiers in Zoology, goats have fewer commonalities with their dull farm counterparts and belong instead on the ungulate honor roll. These furry, hoofed eating machines appear more sheep- or mini-cow-like in their demeanor, but their IQs likely put even the most astute steer to shame, the researchers—real men and women who stare at goats—found.

The researchers, who hail from Queen Mary University of London and the Institute of Agricultural Science in Switzerland, long suspected that goats might be more intelligent than they seem. For example, goats live in complex social groups; they are experts at getting at hard-to-reach foods (goats in the Morocco, for example, are known for climbing trees in search of tasty sprigs); they live a long time, meaning they are better able to build up a repertoire of memories and skills than some short-lived animals; and despite the misconception that goats eat garbage, they are surprisingly picky eaters, able to adeptly pick leaves off of thorn bushes or seek out just the right sprig of grass.

On the other hand, the authors point out, goats have been domesticated—a potential strike against their intelligence. Domesticated animals tend to lack some of the social intricacies and foraging skills of wild ones because they no longer need to know those skills.

To find out just how smart goats really are, the researchers presented the animals with the “artificial fruit challenge”—a cognitive game originally developed by primate scientists. The researchers place fruit inside a box, which could only be reached by solving a puzzle. In this case, the goats had to use their teeth to pull on a rope to activate a lever, and then lift the lever up with their muzzle. If they correctly performed the task, they received a food reward that dropped out of the box.

First, the researchers attempted to teach 12 goats to complete the task. Of those 12, nine were able to master the task after about four tries. Of the three who failed, two tried to take a short cut and use their horns to pry open the box—therefore being disqualified—and another “showed no signs of improvement” by her 22nd try, the team writes, so they wrote her off as a hopeless case.

After identifying the nine winners, the researchers then waited for 10 months and presented the same animals with the food box puzzle to test how long it took them to re-crack the snack-delivering code. All of the goats remembered how to solve the problem, and were able to access the fruit in less than a minute. “The speed at which the goats completed the task at 10-months compared to how long it took them to learn indicates excellent long-term memory,” said Elodie Briefer, the lead author of the paper, in a statement.

The goats did fail in one respect, however. During another trial, the researchers allowed other non-trained goats to observe the smarty-pants goats as they accessed the food reward. But when those peeping tom goats were given the chance to then solve the puzzle themselves, they were no better at figuring out how to get at the treat than goats that had not been given a visual hint about the solution. This could mean that goats prefer to learn on their own, the researchers write, or it could just be that goats have either lost or never possessed that particular social adaptation—being able to learn by watching others—that animals such as dolphins excel at.

So while goats have proven that they are by no means duds in the smarts department, they probably won’t be outwitting dolphins, elephants, chimps or other exceedingly brainy furry or feathered competitors anytime soon.