import sys input = sys.stdin.readline import math def facts(x): xr=math.ceil(math.sqrt(x)) LIST=[] for i in range(1,xr+1): if x%i==0: LIST.append(i) LIST.append(x//i) return sorted(set(LIST)) L,R=map(int,input().split()) # UnionFind Group = [i for i in range(2*10**5+1)] # グループ分け Nodes = [1]*(2*10**5+1) # 各グループのノードの数 def find(x): while Group[x] != x: x=Group[x] return x def Union(x,y): if find(x) != find(y): if Nodes[find(x)] < Nodes[find(y)]: Nodes[find(y)] += Nodes[find(x)] Nodes[find(x)] = 0 Group[find(x)] = find(y) else: Nodes[find(x)] += Nodes[find(y)] Nodes[find(y)] = 0 Group[find(y)] = find(x) for i in range(L): Union(i,0) for i in range(R+1,2*10**5+1): Union(i,0) for i in range(R,L-1,-1): LIST=[j for j in facts(i) if j>=L] for j in LIST: Union(i,j) print(len(set([find(i) for i in range(2*10**5+1)]))-2)