Creating a ID based on number of appearances in the list above

Something like this?