Count the real roots of a univariate polynomial with multiplicity over the reals or a closed interval
CountRoots[f, x]
CountRoots[f, {x, a, b}]
CountRoots[(x - 1)(x - 2)(x - 3)(x - 4), {x, 0, 5}]
→ 4CountRoots[x ^ 3, {x, -1, 1}]
→ 3CountRoots[(x ^ 2 - 2)(x ^ 2 - 5), x]
→ 4