completed solution for CountNonDivisible