answers = Array.new
while line = $stdin.gets
	n = line.chomp.to_i	
	break unless n > 0
	sum = 0
	1.upto( n ){ |i|
		check = i
		while (check % 5) == 0
			sum += 1
			check /= 5
		end
	}
	answers << sum
end
answers.each{ |a| puts a }
