#include <fstream>
#include <cmath>

using namespace std;

ifstream input("LASTZERO.inp");
ofstream output("LASTZERO.out");
int n;

int lagrange(int n, int p)
{
	int i = 1;
	int res = 0;
	while ((int)(n / pow(p, i)) != 0)
	{
		res = res + n / pow(p, i);
		i++;
	}
	return res;
}

int main()
{
	input >> n;
	int a = lagrange(n, 2);
	int b = lagrange(n, 5);
	if (a > b)
	{
		output << b;
	}
	else
	{
		output << a;
	}
	input.close();
	output.close();
	return 0;
}


