def f(x, y): c = 0 for i in range(1, int(y**0.5)+1): for j in range(int(y**0.5)+1): d = i**2+j**2 if (d >= x) and (d <= y): c += 1 c = max(0, c) return (c * 4) x, y = map(int, input().split()) if x ==y: print(f(x, y)) else: for i in range(x, y+1): z = 0 z = max(z, f(i, i)) print(z)