import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np X,Y = map(int,read().split()) U = int(10 ** 3.5 + 10) x = np.arange(-U,U,dtype=np.int32) sq = x * x values = sq[:,None] + sq[None,:] counter = np.bincount(values.ravel(), minlength=10**7+10) answer = counter[X:Y+1].max() print(answer)