import math import fractions L = int(input()) l = math.sqrt(L//4) + 1 c = 0 for m in range(1, L): if m > l: break for n in range(m - 1, 0, -1): if (m - n)%2 != 0 and fractions.gcd(m, n) == 1: if 4 * (2 * (m * n + m**2)) <= L: c += 1 print(c%1000003)