------
## 最终结论
```python
def count_digit_one(n):
    count_of_ones = 0
    for i in range(n + 1):
        count_of_ones += str(i).count('1')
    return count_of_ones

# Example usage:
n = 13
print(count_digit_one(n))  # Output: 6
```