from collections import defaultdict X = int(input()) half = X//2 half2 = X//2+X%2 A = [] for a in range(301): for b in range(a, 301): for c in range(b, 301): if a*a*a+b*b*b+c*c*c <= half: A.append((c, a*a*a+b*b*b+c*c*c)) B = [] for d in range(301): for e in range(d, 301): for f in range(e, 301): if half2 <= d*d*d+e*e*e+f*f*f <= X: B.append((d, d*d*d+e*e*e+f*f*f)) A.sort(key=lambda x:x[0]) B.sort(key=lambda x:x[0]) D = defaultdict(int) idx = len(B)-1 ans = 0 for c, s in A[::-1]: while 0 <= idx and c <= B[idx][0]: D[B[idx][1]] += 1 idx -= 1 ans += D[X-s] print(ans)