import math a,b = map(int,input().split()) cnt = [0] * 10000000 r = int(math.sqrt(b)) for i in range(-r,r+1): for j in range(-r,r+1): if i*i + j*j <= b: cnt[i*i + j*j]+=1 ans = 0 for i in range(a,b+1): ans = max(ans, cnt[i]) print (ans)