R = 2000002 p = [1]*R c = [0]*R p[0] = p[1] = 0 for i in xrange(2,int(R**0.5)): if p[i]: p[2*i::i] = [0]*len(p[2*i::i]) c[i::i] = [j+1 for j in c[i::i]] N,K = map(int,raw_input().split()) print sum(c[i] >= K for i in xrange(2,N+1))