# Express this mathematically

Sorry it has been a while. I have three variables, $X, Y, Z$. Every $X$ has a different number of $Y$ and every $Y$ has a different number of $Z$ so how do I express the total number of $Z$?

For example, say you have people, who all have different number of shirts, which all have a different number of shirt buttons - how do you express the total number of buttons mathematically?

It is not just people $\times$ shirts $\times$ shirt buttons. What is it? Thanks.

Thanks.

-

You let $a_{ij}$ be the number of buttons on the $j$th shirt of the $i$th person, and write $$\sum_{i,j}a_{ij}$$ for the total number of buttons.