
#include <bits/stdc++.h>
using namespace std;
ifstream fi("bai1.inp");
ofstream fo("bai1.out");
long int n,k,i,dem=0,p;
void SieveOfEratosthenes(long int n, bool prime[],
						bool primesquare[],long int a[])
{

	for (i = 2; i <= n; i++)
		prime[i] = true;

	for (i = 0; i <= (n * n + 1); i++)
		primesquare[i] = false;


	prime[1] = false;

	for (p = 2; p * p <= n; p++) {

		if (prime[p] == true) {

			for (i = p * 2; i <= n; i += p)
				prime[i] = false;
		}
	}

	long int j = 0;
	for (p = 2; p <= n; p++) {
		if (prime[p]) {

			a[j] = p;


			primesquare[p * p] = true;
			j++;
		}
	}
}


int countDivisors(long int n)
{


	if (n == 1)
		return 1;

	bool prime[n + 1], primesquare[n * n + 1];

	long int a[n];


	SieveOfEratosthenes(n, prime, primesquare, a);


	long int ans = 1;


	for (i = 0;; i++) {
		if (a[i] * a[i] * a[i] > n)
			break;


		long int cnt = 1;
		while (n % a[i] == 0)
		{
			n = n / a[i];
			cnt = cnt + 1;
		}


		ans = ans * cnt;
	}


	if (prime[n])
		ans = ans * 2;


	else if (primesquare[n])
		ans = ans * 3;


	else if (n != 1)
		ans = ans * 4;

	return ans;
}


int main()
{
    long int n,k,dem=0;
    fi>>n>>k;
    for(long int i=1;i<=n;i++)
    {
        if(countDivisors(i)%k==0)
	       {dem++;}
    }
    fo<<dem;
	return 0;
}
