import java.util.*; public class HatePrenum{ protected List prenumList; public static void main(String... args){ Scanner scan = new Scanner(System.in); HatePrenum hate = new HatePrenum(); int N = scan.nextInt(); int K = scan.nextInt(); int[] d = new int[N+1]; hate.makePrenumList(N); int res=0; if(K==1){ System.out.println(hate.prenumList.size()); return; }else{ for(int i = 2; i <= N; i++){ if(d[i] == 0){ for(int j = 1; i*j<=N; j++){ d[i*j]++; } } } for(int i = 2; i <= N; i++){ if(d[i]>=K)res++; } System.out.println(res); } } public void makePrenumList(int max){ List searchList = new ArrayList(); List prenum = new ArrayList(); double limit = Math.sqrt(max); for(int i = 2; i <= max; i++){ searchList.add(i); } double head = 0.0; int nowHead; while(head < limit){ head = (double)searchList.get(0); nowHead = (int)head; prenum.add(nowHead); for(Iterator it = searchList.iterator(); it.hasNext();){ int num = it.next(); if(num%nowHead==0){ it.remove(); } } } for(Iterator it = searchList.iterator(); it.hasNext();){ prenum.add(it.next()); } this.prenumList=prenum; } }