Using divide-conquer algorithm to count 1