A science teacher is arranging her books on a shelf. She has 4 Astronomy books, 3 Biology books, and 2 Chemistry books. How many ways can she arrange these books on the shelf if the books from each subject must be together?

There 248 ways of arranging the books.