using System; 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 maxSum = 0; for (int k = X; k <= Y; k++) { int sum = 0; int s = 0; int l = (int)Math.Sqrt(k); while (s <= l) { while (s*s + l*l > k) l--; if (s*s + l*l == k) { if (l * l == k || s == l) sum += 4; else sum += 8; s++; l--; } if (s > l) break; while (s*s + l*l < k) s++; if (s * s + l * l == k) { if (l * l == k || s == l) sum += 4; else sum += 8; s++; l--; } } if (sum > maxSum) maxSum = sum; } Console.WriteLine(maxSum); } } }