#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
typedef unsigned long long ull;
int main(){
	ull n;
	ull num2=0,num5=0;
	ull m,k;
	
	cin>>n;
	m=1;k=0;
	while(2*m<=n){m*=2;k++;}
	while(1<m){
		num2 += k*(n/m - n/(m*2));
		k--;
		m /= 2;
	}
	m=1;k=0;
	while(5*m<=n){m*=5;k++;}
	while(1<m){
		num5 += k*(n/m - n/(m*5));
		k--;
		m /= 5;
	}

	cout<<min(num2,num5)<<endl;
	return 0;
}