x = int(input()) m = 301 from collections import Counter import itertools as it lcs = [Counter(a**3 + b**3 for a, b in it.combinations_with_replacement(range(c + 1), 2)) for c in range(m)] rds = [Counter(e**3 + f**3 for e, f in it.combinations_with_replacement(range(d, m), 2)) for d in range(m)] ans = 0 for c, d in it.combinations_with_replacement(range(m), 2): rem = x - c**3 - d**3 if rem < d**3 * 2: continue lc = lcs[c] rd = rds[d] for s, f in lc.items(): ans += f * rd[rem - s] print(ans)