def main1(l,r): if l==1:return 0 g=[set() for _ in range(r-l+1)] for i in range(l,r+1): ii=i+i while ii<=r: g[ii-l].add(i-l) g[i-l].add(ii-l) ii+=i mi=set(range(r-l+1)) ans=0 while mi: ans+=1 v0=mi.pop() todo=[v0] while todo: v=todo.pop() for nv in g[v]: if nv in mi: todo.append(nv) mi.discard(nv) return ans-1 if __name__=='__main__': l,r=map(int,input().split()) ret1=main1(l,r) print(ret1)