kai=[i**2 for i in range(3201)] d=dict() for i in range(3200): for j in range(1,3200): 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)