kai=[i**2 for i in range(1001)] d=dict() for i in range(1000): for j in range(1,1000): d[kai[i]+kai[j]]=d.get(kai[i]+kai[j],0)+1 a,b=map(int, input().split()) ans=0 for i in range(a,b+1): ans=max(ans,d.get(i,0)) print(ans*4)