from math import sqrt

max = 10000

count = dict()

for i in range(max+1):
    if i%100 == 0:
        print(i)
    for j in range(1+int(sqrt(i))):
        for k in range(int(1+sqrt(i-j**2))):
            for l in range(int(1+sqrt(i-j**2-k**2))):
                if j**2+k**2+l**2 == i:
                    break
            if j**2+k**2+l**2 == i:
                break
        if j**2+k**2+l**2 == i:
            break
    if j**2+k**2+l**2 == i:
        count[i] = "{}**2 + {}**2 + {}**2".format(j,k,l)

print("")
print(max+1 - len(count))