n = int(input()) N = n//4 q = [(3,4,5)] ans = 0 while q: a,b,c = q.pop() ans += N >= a+b+c x = 1*a - 2*b + 2*c y = 2*a - 1*b + 2*c z = 2*a - 2*b + 3*c if x+y+z <= N: q.append((x,y,z)) x += 4*b y += 2*b z += 4*b if x+y+z <= N: q.append((x,y,z)) x -= 2*a y -= 4*a z -= 4*a if x+y+z <= N: q.append((x,y,z)) print(ans)