#include<iostream> using namespace std; bool ishave_7(int n); int main(){ int num,k=0; cin>>num; while(num>6){ if(0==num%7){ k++; num--; continue; } if(ishave_7(num)){ k++; } num--; } cout<<k<<endl; } bool ishave_7(int n){ if(n<9&&n!=7){ return false; } if(7==n%10){ return true; } else return ishave_7(n/10); }