Animation after 5 shots

Hello friends unity 3d.

I would like to know how you can run an animation after hitting 5 times a cube that is connected to the animation of my enemy. Let me explain. I created an animation of a spider with a death, I want to insert a cube is hit to kill it after 5 shots. Do you know any script that can do this? Thanks to all!

Split the tasks. You need to detect when the cube hit the spider, you need to increase a variable and finally you need to play an animation when that variable is high enough.