try:while True:list1=input().split(" ")list1=[int(i)for i in list1]num=0if list1[0]==0 and list1[1]==0:print()else:for i in range(list1[0],list1[1]+1):if list1[0]<=i**2 and list1[1]>=i**2:num+=1print(num)except EOFError:pass