package main import ( "fmt" "math" ) func isPrime(n int, r []int) bool { x := int(math.Sqrt(float64(n)) + 1) for _, i := range r { if i > x { break } if n%i == 0 { return false } } return true } func getPrime(n int) ([]int, []int) { p := make([]bool, n+1) // false: 素数の可能性有 true: notPrime r := make([]int, 0) m := make([]int, n+1) for i := 2; i <= n; i++ { if p[i] { continue } if !isPrime(i, r) { continue } r = append(r, i) for j := i; j <= n; j += i { p[j] = true m[j]++ } } return r, m } func main() { var N, K int fmt.Scan(&N, &K) _, m := getPrime(N) ans := 0 //fmt.Println(m) for i := 2; i < N+1; i++ { if m[i] >= K { ans++ } } fmt.Println(ans) }