Then, the number of books on each shelf is 7/x.
The total number of books is x * (7/x) = 7.
Therefore, the number of shelves is 7.