import std.algorithm, std.array, std.container, std.range; import std.numeric, std.math, std.bigint, std.bitmanip, std.random; import std.string, std.conv, std.stdio, std.typecons; void main() { auto l = readln.chomp.to!int; auto k = l / 4; auto max = l.to!real.sqrt.to!int; auto r = 0; foreach (m; 2..max) foreach (n; 1..m) if (isPitagolas(m, n) && sumPitagolas(m, n) <= k) r += 1; writeln(r); } bool isPitagolas(int m, int n) { return gcd(m, n) == 1 && (m - n) % 2 == 1; } int sumPitagolas(int m, int n) { return 2 * m ^^ 2 + 2 * m * n; }