How many ways are there to write 2000 as the sum of powers of 2 with non-negative exponents, where each power is used at most twice?