import scala.collection.mutable.ArrayBuffer import scala.util.control.Breaks._ object Main { // エラトステネスのふるいの方式で、 // 素因数の個数をカウントする def sieve(n: Int): Array[Int] = { val tab = new Array[Int](n+1) for (i <- 2 to n by 2) tab(i) = 1 for (i <- 3 to n by 2) { if (tab(i) == 0) { // i is prime for (j <- i to n by i) { tab(j) += 1 } } } tab } def main(args: Array[String]) { val sc = new java.util.Scanner(System.in) val N, K = sc.nextInt val tab = sieve(N) val ans = (2 to N).count { e => tab(e) >= K } println(ans) } }