using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Code { class Program { static void Main(string[] args) { string line = Console.ReadLine(); string[] values = line.Split(' '); int X = int.Parse(values[0]); int Y = int.Parse(values[1]); int[] rr = new int[Y / 2 + 1]; int i = 1; while (true) { int t = i * i; if (t > Y) break; else { rr[i++] = t; } } int maxSum = 0; for (int k = X; k <= Y; k++) { int sum = 0; for (int s = 0; s * s < k / 2; s++) { for (int l = s; l * l <= k; l++) { if (s * s + l * l == k) { if (l * l == k || s == l) sum += 4; else sum += 8; } } } if (sum > maxSum) maxSum = sum; } Console.WriteLine(maxSum); } } }