def read_nonnegative_int(keyboard_message):
    """
    Print a message and read a non-negative integer from keyboard
    """
    no = input(keyboard_message)
    while True:
        try:
            number = int(no)
        except ValueError:
            pass
        else:
            if number >= 0:
                break
        no = input("One nonnegative integer please: ")

    return number