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!long; l /= 4; auto maxM = (l / 2).to!real.sqrt.to!long; auto r = 0; foreach (long m; 1..(l.to!real.sqrt.to!long + 1)) for (long n = m % 2 + 1; n < m; n += 2) { if (2L * m * (m + n) > l) break; if (gcd(m, n) == 1) ++r; } writeln(r % p); }