from collections import * from itertools import * from functools import * from heapq import * import sys,math input = sys.stdin.readline L,R = map(int,input().split()) class DSU: def __init__(self, n): self._n = n self.parent_or_size = [-1] * n def merge(self, a, b): assert 0 <= a < self._n assert 0 <= b < self._n x, y = self.leader(a), self.leader(b) if x == y: return x if -self.parent_or_size[x] < -self.parent_or_size[y]: x, y = y, x self.parent_or_size[x] += self.parent_or_size[y] self.parent_or_size[y] = x return x def same(self, a, b): assert 0 <= a < self._n assert 0 <= b < self._n return self.leader(a) == self.leader(b) def leader(self, a): assert 0 <= a < self._n if self.parent_or_size[a] < 0: return a self.parent_or_size[a] = self.leader(self.parent_or_size[a]) return self.parent_or_size[a] def size(self, a): assert 0 <= a < self._n return -self.parent_or_size[self.leader(a)] def groups(self): leader_buf = [self.leader(i) for i in range(self._n)] result = [[] for _ in range(self._n)] for i in range(self._n): result[leader_buf[i]].append(i) return [r for r in result if r != []] D = DSU(R+1) E = [] for i in range(L,R): E.append((1,i,i+1)) flg = [False]*(R+1) for i in range(L,R+1): if flg[i]: continue flg[i] = True for j in range(2*i,R+1,i): E.append((0,i,j)) flg[j]=True E.sort() ans = 0 for w,i,j in E: if D.same(i,j): continue ans += w D.merge(i,j) print(ans)