The way you started your code, even if done correctly, would only work for abobora & Cenoura - Squash and carrots I think.
You would then have to check if you have carrots and raddish and then Squash and Radish and then cabbage and squash, cabbage and raddish..... so it becomes a lot.
You want a way to check is there at least one animation on squash, if yes add 1.
Not sure if there is a build in function but you can set a global to 0 every tick, then add 1 if there is atleast one of each type.
Like with mine, only instead of saying the number I have you set your animation based on it.