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()) dl=[i for i in d if a<=i<=b] ans=0 for i in dl: ans=max(ans,d.get(i,0)) print(ans*4)