Question: 
Write a python function to count the total unset bits from 1 to n.


Model's Code:
def count_Unset_Bits(n):
    total_bits = 0
    for i in range(1, n + 1):
        total_bits += bin(i).count('0') - 1  # Exclude the 'b' in the binary representation
    return total_bits



Sample Correct Code:
def count_Unset_Bits(n) :  
    cnt = 0;  
    for i in range(1,n + 1) : 
        temp = i;  
        while (temp) :  
            if (temp % 2 == 0) : 
                cnt += 1;  
            temp = temp // 2;  
    return cnt;  


Asserts:
assert count_Unset_Bits(2) == 1
assert count_Unset_Bits(5) == 4
assert count_Unset_Bits(14) == 17


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 903 of 974: 696/903 (77.0764119601329%): success