from collections import defaultdict Sq = [i**2 for i in range(3201)] PointCounter = defaultdict(int) for i in range(3201): for j in range(i, 3201): if Sq[i] + Sq[j] > 10**7: break if i == j: if i == 0: continue else: PointCounter[Sq[i] + Sq[j]] += 4 else: if i == 0: PointCounter[Sq[j]] += 4 else: PointCounter[Sq[i] + Sq[j]] += 8 x, y = map(int, input().split()) ans = 0 for i in range(x, y + 1): ans = max(ans, PointCounter[i]) print(ans)