from collections import defaultdict def main(): X, Y = map(int, input().split()) r = Y ** 0.5 d = defaultdict(int) for i in range(int(-r),int(r)+1): for j in range(int(-r),int(r)+1): if i**2 + j**2 <= Y: d[i**2 + j**2] += 1 ans = 0 for i in range(X, Y + 1): ans = max(ans, d[i]) print(ans) if __name__ == "__main__": main()