a[2010000];s,j;main(i){for(;++i<2e3;)if(!a[i])for(j=0;j<2e6;a[j+=i]++);for(scanf("%d%d",&i,&j);i;s+=a[i--]>=j);s=!printf("%d",s);}