print len for in range 1000000 if 100000 10000 10 1000 10 1000 100 100

1
print len([x for x in range(1000000) if x/100000+x/10000%10+x/1000%10 == x % 1000/100 + x%100/10 + x%10])