from collections import defaultdict X = int(input()) c_list = defaultdict(list) cnt = defaultdict(int) ans = 0 for c in range(301): for b in range(c+1): for a in range(b+1): T = a**3 + b**3 + c**3 c_list[T].append(c) for d in range(301): for e in range(d, 301): for f in range(e, 301): T = X - d**3 - e**3 - f**3 if T not in c_list: continue while cnt[T] < len(c_list[T]) \ and c_list[T][cnt[T]] <= d: cnt[T] += 1 ans += cnt[T] print(ans)