





'''simple docstring'''


def 		__a(SCREAMING_SNAKE_CASE_					:   int      ):



    '''simple docstring'''





    barcode //= 10  # exclude the last digit
    _lowerCAmelCase		     = False
    _lowerCAmelCase		     = 0

    # extract and check each digit
    while barcode != 0:
        _lowerCAmelCase		     = 1 if checker else 3
        s += mult * (barcode % 10)
        barcode //= 10
        _lowerCAmelCase		     = not checker

    return (10 - (s % 10)) % 10


def 		__a(SCREAMING_SNAKE_CASE_					:   int      ):



    '''simple docstring'''





    return len(str(SCREAMING_SNAKE_CASE_      )      ) == 13 and get_check_digit(SCREAMING_SNAKE_CASE_      ) == barcode % 10


def 		__a(SCREAMING_SNAKE_CASE_					:   str      ):



    '''simple docstring'''





    if str(SCREAMING_SNAKE_CASE_      ).isalpha():
        _lowerCAmelCase		     = F'''Barcode \'{barcode}\' has alphabetic characters.'''
        raise ValueError(SCREAMING_SNAKE_CASE_      )
    elif int(SCREAMING_SNAKE_CASE_      ) < 0:
        raise ValueError("The entered barcode has a negative value. Try again."      )
    else:
        return int(SCREAMING_SNAKE_CASE_      )


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       _SCREAMING_SNAKE_CASE			=							get_barcode(input("Barcode: ").strip())

       if is_valid(barcode):
              print(f'''\'{barcode}\' is a valid barcode.''')
       else:
              print(f'''\'{barcode}\' is NOT a valid barcode.''')









'''simple docstring'''


def 		__a(SCREAMING_SNAKE_CASE_					:   List[Any]						,    SCREAMING_SNAKE_CASE_					:   str      ):



    '''simple docstring'''





    if n < 0:
        return 0
    # table[i] represents the number of ways to get to amount i
    _lowerCAmelCase		     = [0] * (n + 1)

    # There is exactly 1 way to get to zero(You pick no coins).
    _lowerCAmelCase		     = 1

    # Pick all coins one by one and update table[] values
    # after the index greater than or equal to the value of the
    # picked coin
    for coin_val in s:
        for j in range(SCREAMING_SNAKE_CASE_						,    n + 1      ):
            table[j] += table[j - coin_val]

    return table[n]


if __name__ == "__main__":
       import doctest

       doctest.testmod()


