Than create some table with 2 columns - content_type_id and count. To content types add a text field and before mentioned beforeStore filed with code that first checks if this is a new item - if this is true, than read number from table you created, increase it by one and save this number back to table and to the text field you have on item. Just some basic logic..