Count 0s and 1s in sequence