```python
def digit_count(value: int) -> int:
    """
    Return how many digits a whole number is written with.
    """
    if value == 0:
        return 1
    elif value < 0:
        return 0
    elif value == -1:
        return 1
    else:
        return 1 + digit_count(value // 10)
```