Elliot has 28 mystery books and 35 fantasy books that he wants to put on shelves. Each shelf will have the same number of books. Elliot wants to put only one type of book on each shelf. What is the greatest number of books that he will put on each shelf?