import std.algorithm, std.conv, std.range, std.stdio, std.string; import std.math; // math functions import std.numeric; // gcd const auto p = 1000003; void main() { auto l = readln.chomp.to!int; l /= 4; auto maxM = (l / 2).to!real.sqrt.to!int; auto r = 0; foreach (m; iota(2, maxM + 1)) foreach (n; iota(1, m, 2)) { if (2 * m * (m + n) > l) break; if (gcd(m, n) == 1) ++r; } writeln(r % p); }