Amazon Interview Question

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