import sys input = sys.stdin.readline 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 if S>X: continue LIST.append(S*(302*302)+a*302+c) LIST.sort() for p in LIST: c=p%302 p//=302 a=p%302 S=p//302 if S>X: continue k=X-S x=bisect(LIST,k*(302*302)) for i in range(x,10**9): if i==len(LIST): break y=LIST[i] f=y%302 y//=302 d=y%302 l=y//302 if k==l and c<=d: ANS+=1 else: break print(ANS)