#include <bits/stdc++.h>
using namespace std;
int main(){
int i=1,b,j,h=0,n;
cin>>n;
for(i=1;i<=n;i++){
	j=i;
	if(i%5==0){
		
		while(j>0){
		b=j%10;	
		j=j/10;
		if(b==5){
			h++;
			break;
		}
	}
	}
	
	
	
}
cout<<h<<endl;
}

/**************************************************************
	Problem: 1057
	User: linweilun
	Language: C++
	Result: Accepted
	Time:16 ms
	Memory:2072 kb
****************************************************************/