import sys readline = sys.stdin.readline ns = lambda: readline().rstrip() ni = lambda: int(readline().rstrip()) nm = lambda: map(int, readline().split()) nl = lambda: list(map(int, readline().split())) def solve(): l, r = nm() s = [1]*(r+1) for i in range(l, r+1): for j in range(i*2, r+1, i): s[j] = 0 print(sum(s[l+1:])) return solve()