Yes, fine if this gives you what you want, but, you will notice that this solution first needs to reorganize the data structure into another data structure (
%containers) to make the counting easy.
So I think that you should really not neglect stevieb's useful comment (in post Re: Count array element in HASH of ARRAYS) that it might be better to build in the first place a data structure making your requirement easier to implement. It may or may not be possible in your specific case, but if there is a way of building something like %containers in the first place, then you are in a much easier solution.