Separate the list in commas (split). Loop inside another loop Take the N element and compare it to the original list in the second loop and use a counter to set the quantity.
List split
( 111 222 111 444 888 444 111 444)
( 111,222,111,444,888,444,111,444)
This a original list