class Integer def isqrt return 0 if self<=0 return 1 if self<4 # 1 x,y=0,self while x!=y&&x+1!=y x,y=y,(self/y+y)/2 end x end end H=Hash.new 0 X,Y=gets.split.map &:to_i R=Y.isqrt (1..R).each{|x|(0..R).each{|y|H[x*x+y*y]+=1}} p (X..Y).map{|i|H[i]}.max*4