N,K = map(int,raw_input().split()) fn = [1]*(N+1) fn[0] = fn[1] = 0 is_p = [True]*(N+1) for f in xrange(2,N/2+1): if not is_p[f]:continue d = f*2 while d <= N: if is_p[d]: is_p[d] = False else: fn[d] += 1 d += f print len(filter(lambda x:x>=K,fn))