Jelly, 65 bytes
!ÆEṫ3ḢÆfċ5
Uses the counterproductive approach of finding the factorial then factorising it again, checking for the exponent of 5 in the prime factorisation.
! Factorial
ÆEÆf List of prime exponentsfactors, e.g. 120 -> [3, 1[2, 1]
ṫ3 Remove the first two elements - if n < 52, this results in an empty list
Ḣ Pop first2, returning the exponent of 5 if ÆE returned a list of length >= 3,
5]
ċ5 otherwise 0 is returnedCount implicitlynumber returnedof instead5s
Note that we can't index with 3ị
since ị
works cyclically, and for n = 4
it would extract 3
from the factorisation list [3, 1]
.