By substitution,

so that after
steps, we end up with

A trailing zero in 2022! comes from factor of 10 = 2×5. The prime factorization of 2022! has a lot more 2s than 5s, so we only need to count how many 5s occur in the factorization. Note that
2022 = 5×404 + 2 ⇒ 404 multiples of 5
2022 = 5²×80 + 22 ⇒ 80 multiples of 5²
2022 = 5³×16 + 22 ⇒ 16 multiples of 5³
2022 = 5⁴×3 + 147 ⇒ 3 multiples of 5⁴
and 5⁵ = 3125 > 2022. So there is total of
404 + 80 + 16 + 3 = 503
distinct factors of 5 in 2022!, and thus 503 trailing zeros in 2022!.
Since
, and the highest power of 5 that divides 1000 is 5⁴ = 625, we know that multiplying 2022! by
can introduce up to 4 more pair-able factors of 5.
So the sum of all the possible numbers of zeros in
is
503 + 504 + 505 + 506 + 507 = 2525