#a121 from math import sqrt while True: try: a,b=map(int,input().split()) a,b=min(a,b),max(a,b) number=[i for i in range(a,b+1)] for candidate in range(2,int(sqrt(b))+1): trial=candidate*candidate while trial<=b: if trial in number: number.remove(trial) trial+=candidate print(len(number)) except: break