Solved CountFactors in C