import scala.collection.mutable.ArrayBuffer import scala.util.control.Breaks._ object Main { def sieve(n: Int): Array[Int] = { val primes = new ArrayBuffer[Int]() if (n >= 2) primes.append(2) val tab = new Array[Boolean](n+1) for (i <- 3 to n by 2) { if (!tab(i)) { // i is prime primes.append(i) for (j <- i+i to n by i) { tab(j) = true } } } primes.toArray } def fac(n: Int, primes: Array[Int]): Array[Int] = { val ps = new ArrayBuffer[Int]() var x = n breakable { for (prime <- primes) { if (prime * prime > x) break while (x % prime == 0) { ps.append(prime) x /= prime } } } if (x > 1) ps.append(x) ps.toArray } def main(args: Array[String]) { val sc = new java.util.Scanner(System.in) val N, K = sc.nextInt val primes = sieve(N) val ans = (2 to N).count { e => fac(e, primes).toSet.size >= K } println(ans) } }