Digit Counting

Time Limit: 3.000 seconds