Objects

i am trying to make a game with multiple objects in it. to complete the game you have to get them all. how could i make it so that it counts how many of the object there isin a variable or something? :?: