#include<bits/stdc++.h>
using namespace std;
ifstream fi("BAI1_18.inp");
ofstream fo("BAI1_18.out");

int uoc(int x){
   int t=1,c=0;
   for(int i=2;i<=x;++i){
     while(x%i==0){x=x/i;++c;}
     t=t*(c+1);
     c=0;
   }
   return t;
}

int main(){
    int i,j,n,k,ans=0;
    fi>>n>>k;
    vector<int>snt(n+1,1);
    snt[1]=0;
    i=2;
    while (i<=sqrt(n))
    {
        while (snt[i]==0)
            i++;
        for (j=2; j<=n/i; j++)
            snt[i*j]=0;
        i++;
    }
   for(int i=1;i<=n;++i){
       if(k!=2 && snt[i]==1)continue;
       if(k==2 && snt[i]==1){++ans;continue;}
       if(uoc(i)==k){++ans; for(int j=2;j*i<=n;++j)snt[i*j]=1; }
   }
   fo<<ans;
}
