The Old University's library, a gift from João V in the early 18th century, seems too extravagant and distracting for study with its rosewood, ebony and jacaranda tables, elaborately frescoed ceilings and gilt chinoiserie bookshelves. Its 300,000 ancient books deal with law, philosophy and theology. A lower floor has more tomes and the Prisão Acadêmica, a lock-up for misbehaving students.