from collections import defaultdict from itertools import combinations_with_replacement X = int(input()) C = defaultdict(list) D = defaultdict(list) for a, b, c in combinations_with_replacement(range(301), 3): x = a**3 + b**3 + c**3 if 2 * x <= X: C[x].append(c) elif x <= X: D[x].append(a) cnt = 0 for x in C: if 2 * x > X: break y = X - x C[x].sort() j = 0 for i in range(len(C[x])): while j < len(D[y]) and D[y][j] < C[x][i]: j += 1 cnt += len(D[y]) - j print(cnt)