target=1001
d1=[[False]*target for i in range(target)]
d2=[[False]*target for i in range(target)]
d3=[[False]*target for i in range(target)]
r=0
for x in range(target):
for y in range(x,target):
for z in range(y,target):
if not any([d3[y-x][z-y],d2[z][y-x],d2[y][z-x],d2[x][z-y],d1[y][z],d1[x][z],d1[x][y]]):
d3[y-x][z-y]=d2[z][y-x]=d2[y][z-x]=d2[x][z-y]=d1[y][z]=d1[x][z]=d1[x][y]=True
r+=x+y+z
if x%10==0:print x/10,"percent completed"
print r