import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); if (k == 1) { System.out.println(n - 1); return; } TreeSet primes = new TreeSet<>(); primes.add(2); for (int i = 3; i <= n / 2; i += 2) { if (isPrime(i, primes)) { primes.add(i); } } int count = 0; for (int i = 2; i <=n; i++) { if (primes.contains(i)) { continue; } if (hasCount(i, k, primes)) { count++; } } System.out.println(count); } static boolean hasCount(int x, int k, TreeSet primes) { int count = 0; for (int y : primes) { if (Math.sqrt(x) < y) { break; } if (x % y == 0) { count++; if (count >= k) { return true; } while (x % y == 0) { x /= y; } } } if (x != 1) { if (count + 1 >= k) { return true; } } return false; } static boolean isPrime(int x, TreeSet primes) { for (int y : primes) { if (Math.sqrt(x) < y) { break; } if (x % y == 0) { return false; } } return true; } }