CountSemiprimes solution