n = int(input()) ans = 0 cubes = {} for a in range(301): a3 = a * a * a for b in range(a, 301): b3 = b * b * b for c in range(b, 301): c3 = c * c * c x = a3 + b3 + c3 if x not in cubes: cubes[x] = 0 cubes[x] <<= 9 cubes[x] |= c for d in range(301): d3 = d * d * d for e in range(d, 301): e3 = e * e * e for f in range(e, 301): f3 = f * f * f x = d3 + e3 + f3 z = n - x if z in cubes: zero = True w = cubes[z] while w > 0 or zero: if w & 0x1ff <= d: ans += 1 w >>= 9 zero = False print(ans)