The scientists found that the giraffes more often chose the container which contained the most carrots.

Researchers suggested that this showed that the giraffes were mentally adding up the carrots in each container, before making their final choice.

However, when scientists tried the experiment in reverse and took food away from each container, it was a bit too tricky for the giraffes.

Iker Loidi, who helped lead the study, explained that “subtraction is more difficult than addition” – something he said that is also true for people too.

Scientists think these clever adding up skills may help giraffes survive in the wild.

Acacia trees, which giraffes feed on, can be spread far apart across the African savanna, so being able to work out where their biggest meal is could be helpful to them.

Giraffes also live in groups that often split up and regroup, meaning they have to keep track of both their surroundings and other animals.

So next time you are doing your maths homework, just remember – somewhere out there, a giraffe might be doing some sums itself.