l, r = map(int, input().split()) ans = -1 used = [False for _ in range(r+1)] for i in range(l, r+1): if used[i] == False: ans += 1 for j in range(i, r+1, i): used[j] = True print(ans)