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

	cout<<ans<<endl;
	return 0;
}