Bees apparently have a grasp of basic math, including addition and subtraction, a new study has discovered.

The study, published in Science Advances, reveals that bees have incredibly powerful brains for their size and suggests that more animals than we thought can do math.

Scientists trained individual honeybees to recognize colors as plus or minus symbols — and armed with this knowledge, they went on to solve basic mathematical problems set by the scientists.

The bees completed the tasks with a success rate of up to 75 percent.

So what’s the point of this new discovery? Understanding how a tiny bee brain can do arithmetic could lead to better artificial intelligence (AI) systems, according to the Australian and French team.

The study’s author, professor Adrian Dyer from RMIT University in Australia, said: “Our findings suggest that advanced numerical cognition may be found much more widely in nature among non-human animals than previously suspected.

“If math doesn’t require a massive brain, there might also be new ways for us to incorporate interactions of both long-term rules and working memory into designs to improve rapid AI learning of new problems.”

The 14 bees taking part in the study were trained to enter a Y-shaped maze consisting of a tunnel with two exits.

At the entrance, the bees were shown various shapes — a square, diamond, circle or triangle — colored either yellow or blue.

The number of elements — from one to five — was randomly altered throughout the trials.

Each color represented a different mathematical operation — blue for “add one” and yellow for “subtract one.”

Once inside the maze, the bees entered a “decision chamber” where they had to choose whether to take the left or right fork of the “Y.”

More shapes presented at the mouth of each fork represented the correct and incorrect answer to the problem.

If two blue shapes were displayed at the entrance, for instance, the “correct” arm of the “Y” was the one marked by three symbols.

In this case, the bees had to work out that two plus one equals three.

If the bees were initially greeted by two yellow shapes, it meant they had to fly into the arm marked by one symbol (the correct answer to the sum two minus one).

Right answers were rewarded with a tasty drink of sugar water while making a mistake was “punished” with bitter quinine solution.

Training took place over 100 trials, during which the bees made random choices until they learned how to crack the problem.

It took up to seven hours for them to learn that blue meant “plus one” and yellow meant “minus one.”

Each bee was then given four tests involving two addition and two subtraction operations.

The bees chose the correct option between 60 percent and 75 percent of the time.

They pointed out that solving even basic math problems required the mental ability to understand abstract rules and an efficient short-term working memory.

“You need to be able to hold the rules around adding and subtracting in your long-term memory, while mentally manipulating a set of given numbers in your short-term memory,” said Dyer.