#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;
}
int 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;
  FOR(i, 2, n / k) {
    if (F[i] > 0) continue;
    for (int j = i * 2; j < n; j += i) {
      F[j]++;
      if (F[j] == k) ans++;
    }
    F[i] = 1;
  }
  printf("%d\n", ans);
}