We have livestock working dogs. They do guarding and herding as well as other jobs on our farm. They do math. They can differentiate less, more, count, know numbers (we use numbers with them) and do simple addition.
Yes, these are not your ordinary pet dog - they're bred for intelligence and work at their jobs from a very young age so this may not be representative of all dogs. However, if our dogs can do math I'm not at all surprised monkeys can and I expect apes including chimpanzees and dolphins can probably do math too. These are social, cooperative animals and most of them are hunters which tends to develop brain hardware and skills.