#pragma GCC optimize("O3") #pragma GCC target("avx") #include "bits/stdc++.h" using namespace std; // #define int long long #define REP(i, n) for (int i = 0; i < (n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define FORR(i, a, b) for (int i = (b - 1); i >= (a); i--) #define ALL(a) begin(a), end(a) #define let const auto int scan() { int result = 0; while (true) { auto k = getchar_unlocked(); if (k < '0') break; result = 10 * result + k - '0'; } return result; } int16_t F[20000010]; signed main() { let n = scan(); let k = scan(); if (k == 1) { printf("%d\n", n - 1); return 0; } else if (k >= 8) { printf("0\n"); return 0; } int ans = 0; const int n1 = n + 1; FOR(i, 2, n / k + 1) { if (F[i] > 0) continue; for (int j = i; j < n1; j += i) { F[j]++; if (F[j] == k) ans++; } } printf("%d\n", ans); }