Counting Bits

Try to solve the Counting Bits problem.

Statement