#include<bits/stdc++.h>
using namespace std;
int main(){
int g,N,i,j,h=0;
cin>>N;
for(i=1;i<=N;i++){
j=i;
if(j%5==0){
while(j>0){
g=j%10;
j=j/10;
if(g==5){
h++;
break;
}
}
}
}
cout<<h;
return 0;
}
/**************************************************************
Problem: 1057
User: zhangchenhao
Language: C++
Result: Accepted
Time:15 ms
Memory:2072 kb
****************************************************************/