X=int(input())
D={};N=300;ans=0
A=[i**3 for i in range(N+1)]
for d in range(N+1):
  for b in range(d+1):
    for a in range(b+1):
      p=A[a]+A[b]+A[d]
      if p not in D:
        D[p]=0
      D[p]+=1
  for e in range(d,N+1):
    for f in range(e,N+1):
      p=X-(A[d]+A[e]+A[f])
      if p in D:
        ans+=D[p]
print(ans)