Bees can solve seemingly clever counting tasks with very small numbers of nerve cells in their brains, according to researchers.