extract counting_ones_and_fives method