Number of books: B
Number of students: S
We know that the classroom library has 17 more books than 3 times the number of students. Then:

Additionally, if 5 students are absent, each student can borrow exactly 4 books. Then:

Now, using these two results:

There are 37 students in the class.