For each number, if it's already in the set, the program decreases it until it's either zero or a unique number, counting the number of operations performed.