Counting by ones and zeros