import math import fractions L = int(input()) ans = [] maxm = int(math.sqrt(L//4)+1) for m in range(1, maxm, 1): for n in range(1, m, 1): if (m-n)%2 == 1: q = (m**2+n**2)+(2*m*n)+(m**2-n**2) if q * 4 < L: if fractions.gcd(m, n) == 1: ans.append(q) else: break print(len(ans)%1000003)