123456789
unsigned result = 0; for (i=0; i<31; ++i) { for (j=i+1; j<32; ++j) { if (i | j == 31) { result += count[i] * count[j]; } } } return result;