#include <iostream>
using namespace std;

int main()
{
	int n;

	cin >> n;

	while (n > 0) {
		int m = 0;

		while (n > 0) {
			m += n / 5;
			n /= 5;
		}

		cout << m << endl;

		cin >> n;
	}

	return 0;
}
