import sys input = sys.stdin.readline import numpy def main(): n=int(input()) d=[0]*81000001 ans = 0 for m0 in range(0,301): for m1 in range(0,m0+1): for m2 in range(m1,m0+1): d[m0*m0*m0+m1*m1*m1+m2*m2*m2]+=1 for m1 in range(m0, 301): for m2 in range(m1, 301): v = n-m0*m0*m0-m1*m1*m1-m2*m2*m2 if v < 0: break elif v <= 81000000: ans+=d[v] print(ans) if __name__ == "__main__": main()