def count_digits(num: int) -> int:
    """
    Counts how many digits are present in a number
    :param num:
    :return: returns the number of digits in an integer
    :rtype: int
    """
    num_digits = 0
    # so far as the number is greater than zero
    while num > 0:
        num_digits += 1
        num = num // 10  # integer divide to get rid of the last digit
    return num_digits