The teacher said that the students should read at least B pages in their history books. Pat read twice that amount in the morning. The book was so interesting that she read seven more pages in the afternoon. Jeff started with B pages, but he also became interested and read 17 more pages before he stopped. When he talked to Pat, he discovered that they had read exactly the same number of pages. What is the value of B?