It looks like you want to count your products, not to sum up something there!
Something like this must work for you:
Code:
=COUNTIFS($A$2:$A$100, "12345*")
for 1st one, etc.
In case you want to do this for all products in single go, you must have a table of products, and a column for product counts there - something like (on fly):
Code:
=COUNTIFS(YourSheet!$A$2:$A$100, $A2 & "*")