#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b=1,c,d,e=0;
cin>>a;
while(b<=a){
b=d;
while(d>0){
c=a%10;
d=d/10;
if(c==5){
if(b%5==0){
e++;
}
}
}
}
cout<<e;
}
/**************************************************************
Problem: 1057
User: panyuchen
Language: C++
Result: Time Limit Exceed
****************************************************************/