n = gets.to_i
until n == 0
 sum = 1
 while n > 0
  sum *= n
  n -= 1
 end
 strsum = sum.to_s
 strspl = strsum.split("")
 lengthind = strspl.length - 1
 ans = 0
 while lengthind != 0
 if strspl[lengthind] == "0"
  ans += 1
 elsif strspl[lengthind] != "0"
  break
 end
 lengthind -= 1
 end

 puts ans


 n = gets.to_i
end
