import sys input=lambda: sys.stdin.readline().rstrip() l,r=map(int,input().split()) n=r-l+1 par=[-1]*n def find(x): if par[x]<0: return x else: par[x]=find(par[x]) return par[x] def unite(x,y): x=find(x) y=find(y) if x==y: return False else: if par[x]>par[y]: x,y=y,x par[x]+=par[y] par[y]=x return True def same(x,y): return find(x)==find(y) def size(x): return -par[find(x)] for i in range(l,r+1): mul=2 while mul*i<=r: unite(i-l,i*mul-l) mul+=1 ct=0 for i in range(n): if par[i]<0: ct+=1 print(ct-1)