finding the total number of alive objects