L=[] for d in range(0,301): for e in range(d,301): for f in range(e,301): u=d**3+e**3+f**3 L.append(u*1000+d) from bisect import bisect_right result=0 N=int(input()) L.sort() for a in range(0,301): for b in range(a,301): for c in range(b,301): x=N-(a**3+b**3+c**3) u=x*1000+c pos1=bisect_right(L,x*1000+400) pos2=bisect_right(L,u-1) result+=pos1-pos2 print(result)