I'd agree with cairnswm - it's 30. Convert 999999999 to binary and there are 30 digits. You can then just ask if each digit of the binary number is a 1.

Peter