import sys from collections import defaultdict sys.setrecursionlimit(10**7) def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) L,R = MI() X = [i for i in range(L,R+1)] for i in range(2,10**6+1): s = i**2 for j in range(s*((L+s-1)//s)-L,s*(R//s+1)-L,s): X[j] = 0 for j in range(i*((L+i-1)//i)-L,i*(R//i+1)-L,i): if X[j] % i == 0: X[j] //= i def is_square(x): y = int(x**.5) for i in range(y-1,y+2): if i**2 == x: return True return False ans = 0 for x in X: if x == 1: ans += 1 elif x == 0: continue else: if not is_square(x): ans += 1 print(ans)