Amazon interview question

Write a function that takes an integer and counts the number of bits.