to count number of high or low bits