in how many ways can i arrange 3 different math books and 5 different history books on my bookshelf, if i require there to be a math book on both ends?