It takes 1000 digits to number the pages of a book consecutively. How many pages are there?
Implement count_pages(total_digits) to return the page count when numbering starts at 1. Return -1 when no whole page count uses exactly that many digits, and return 0 when total_digits is 0. The input is a nonnegative integer.
def count_pages(total_digits):