#include #define For(i, a, b) for(long long i = a; i < b; i++) #define rep(i, n) For(i, 0, n) #define rFor(i, a, b) for(long long i = a; i >= b; i--) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using namespace std; using lint = long long; using ld = long double; int INF = 2000000000; lint LINF = 1000000000000000000; struct Sieve { private: int n; vector IdxtoVal, ValtoIdx; vector deleted; void build() { int sz = (n % 30 == 0 ? n / 30 : n / 30 + 1); sz *= 8; IdxtoVal = {1, 7, 11, 13, 17, 19, 23, 29}; for (int i = 0; i < 8; i++) { ValtoIdx[IdxtoVal[i]] = i; } deleted.assign(sz, false); for (int i = 1; i < sz; i++) { if (deleted[i]) { continue; } int p = getval(i); for (int j = i; j < sz; j++) { int q = getval(j); if (q > n / p) { break; } deleted[getidx(p * q)] = true; } } } int getval(int i) { return i / 8 * 30 + IdxtoVal[i % 8]; } int getidx(int x) { return x / 30 * 8 + ValtoIdx[x % 30]; } public: Sieve(int n_) : n(n_), IdxtoVal(8), ValtoIdx(30) { build(); } bool isprime(int x) { if (x == 1) { return false; } else if (x == 2 || x == 3 || x == 5) { return true; } else if (x % 2 == 0 || x % 3 == 0 || x % 5 == 0) { return false; } else { return !deleted[getidx(x)]; } } vector primes() { vector res; for (int i = 2; i <= n; i++) { if (isprime(i)) { res.emplace_back(i); } } return res; } }; int main() { lint n, k; cin >> n >> k; auto ps = Sieve(n).primes(); vector ans(n + 1), used(n + 1); vector visit(n + 1, false); auto dfs = [&](auto dfs, lint now, int cnt) -> void { visit[now] = true; if (cnt >= k) { ans[now] = 1; } for (lint p : ps) { lint nnow = now * p; if (nnow > n) { break; } if (visit[nnow]) { continue; } used[p]++; dfs(dfs, nnow, cnt + (used[p] == 1)); used[p]--; } }; dfs(dfs, 1LL, 0); cout << accumulate(ALL(ans), 0) << endl; }