How can I check how many times a variable is true?

I think you should use a int variable to count something, and cast a bool to int will always be 1.