import sys input = sys.stdin.readline from operator import itemgetter from bisect import bisect X=int(input()) D=dict() ANS=0 LIST=[] for a in range(301): for b in range(a,301): for c in range(b,301): S=a**3+b**3+c**3 LIST.append((S,a,b,c)) LIST.sort(key=itemgetter(0)) for S,a,b,c in LIST: if S>X: continue k=X-S x=bisect(LIST,(k,-1,-1,-1)) for i in range(x,10**9): if LIST[i][0]==k: d,e,f=LIST[i][1:] if c<=d: ANS+=1 else: break print(ANS)