title: Count numbers with prime digit
body: <p>Given a number N I need to find the count of the numbers that have atleast one prime digit (2,3,5 or 7) from 1 to N.</p>
  
  <p>Now N can be upto 10^18.What is the best approach to solve this problem.</p>
  
  <p><strong>Example :</strong> Let N = 100 the answer is 64.</p>
  
  <p>Please help to solve this problem.</p>
  
  <p><strong>Code :</strong> This is main function.But obviously not good approach</p>
  
  <pre><code>    long long int n;
      cin&gt;&gt;n;
      long long int count=0;
      for(int i=1;i&lt;=n;i++){
          long long temp=i;
          while(temp&gt;0){
              int rem=temp%10;
              if(rem==2 || rem==3 ||rem==5 || rem==7){
                  count++;
                  break;
              }
              temp=temp/10;
          }
      }
  </code></pre>