import sys input = sys.stdin.readline def main(): n=int(input()) l = 300*300*300*3//4+1 d=[0]*l ans = 0 for m0 in range(0,301): m03 = m0*m0*m0 for m1 in range(0,m0+1): m13 = m1*m1*m1 for m2 in range(m1,m0+1): m23 = m2*m2*m2 idx = m03+m13+m23 d[idx//4] += 1 << (idx%4*8) for m1 in range(m0, 301): m13 = m1*m1*m1 for m2 in range(m1, 301): m23 = m2*m2*m2 idx = n - m03 - m13 - m23 if 0 <= idx and idx//4 < l: ans+=(d[idx//4]>>(idx%4*8))%256 print(ans) if __name__ == "__main__": main()