Amazon interview question

Count all ones in a binary string