import sys input = sys.stdin.readline def read_values(): return tuple(map(int, input().split())) def read_list(): return list(read_values()) def main(): n = int(input()) d = dict() for i in range(0,301): for j in range(i,301): for k in range(j,301): w = i*i*i+j*j*j+k*k*k v = i+j*301+k*301*301 if not w in d: d[w]=[] d[w].append(v) ans=set() for k,l in d.items(): if n-k in d.keys(): for v1 in l: a1 = v1%301 a2 = (v1//301)%301 a3 = v1//(301*301) for v2 in d[n-k]: a4 = v2%301 a5 = (v2//301)%301 a6 = v2//(301*301) add=[a1,a2,a3,a4,a5,a6] add.sort() adv=0 mul = 1 for a in add: adv+=mul*a mul*=301 ans.add(adv) print(len(ans)) if __name__ == "__main__": main()