sum of characters used in numbers 1 to 1000