This is not possible.
If your animations are named like A1, A2, A3.., you can simply store the total number in a variable.
Another option is to try to change the animation, and then check if it has changed. For example, the current animation is A1 and you're changing it to A99. Then check if A99 is playing. If not - then A99 doesn't exist.