def get_number(message, error_message):
    """
    Get a number from user.

    :param message: user message
    :type message: str
    :param error_message: error message
    :type error_message: str
    :return: number as int
    """
    number = 0
    while True:
        try:
            number = int(input(message))
            break
        except Exception:
            print(error_message)
    return number
