ok, now I understand....much harder to do.
2 approaches come to mind:
1) create a shared variable which is a delimited string which would keep track of both size and quantity like: |1x30|3x55|, then you would search for the xYY and get the quantity (actually |30x1|55x3| would probably be easier)
2) use arrays. you could have a reference array of the standard sizes (this could be skipped as long as it is documented somewhere), then you just need to increment the correct array index.
for either of these methods to work, you would need to parse your string (splitting would probably be nice as you already have the code to split into an array) and update whichever method you are using.
finally, you will need to take the results and display them in whatever fashion you desire.
more work, but doable.
HTH