local function getgcd(x, y) while 0 < x do x, y = y % x, x end return y end local x = io.read("*n") x = math.floor(x / 4) local ret = 0 for n = 1, x do if x < 2 * (n + 1) * (2 * n + 1) then break end for m = n + 1, x, 2 do local sum = 2 * m * (m + n) if x < sum then break else if getgcd(m, n) == 1 then ret = ret + 1 end end end end print(ret % 1000003)