import sys input = sys.stdin.readline n = int(input()) if n==0: print(1) exit() 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 y = (a << 18) | (b << 9) | c cubes[x] = (cubes.get(x,0) << 27) | y for x, tw in cubes.items(): z = n - x w1 = tw if not z in cubes: continue while w1: z = n - x w2 = cubes[z] while w2: if w2 & 0x1ff <= (w1 >> 18) & 0x1ff: ans += 1 w2 >>= 27 w1 >>= 27 w = cubes.get(n,0) while w: ans += 1 w >>= 27 print(ans)