Consider the following expression for the number of books b in a library:
$$b = 3x + 5$$
where x is the number of shelves in the library. If the library can accommodate up to 50 books, what is the maximum number of shelves x that the library can have?