def fact(n)
  return (1..n).inject(:*)
end

def countLastZeros(num)
  num_list = num.to_s.split('').reverse
  zeroCount = 0
  num_list.each do |n|
    if n == "0"
      zeroCount += 1
    else 
      break
    end
  end
  return zeroCount
end

if __FILE__ == $0
  while line = gets
    n = line.to_i
    if n == 0
      break
    end
    puts countLastZeros(fact(n))
  end
end