#include <bits/stdc++.h>
using namespace std;
bool test (long a, int k)
{
	long i=2, dem=0;
	while (i<a)
	{
		if (a%i==0) dem ++;
		if (dem>k-2) return false;
		i++;
	}
	if (dem==k-2) return true;
}
int main ()
{
	freopen ("BAI1_18.inp" , "r", stdin);
	freopen ("BAI1_18.out", "w", stdout);
	long a, dem=0;
	int k;
	cin>> a >> k;
	if (k==1) cout << 1;
	else 
	{
		if (k%2==1) 
		{
		for (long i=2; i<=sqrt(a); i++)
		if (test (i*i,k) == true ) dem ++;
		cout << dem;
		}
		else 
		{
		for (long j=k; j<=a; j++)
		if (test (j,k)==true) dem ++;
		cout << dem;
		}
	}
}
