A library receives a large cash donation and uses the funds to double the number of books it owns. Then a book collector gives the library 4028 books. After this, the library has 51,514 books. How many books did the library have before the cash donation and the gift of books?

2 b + 4028 = 51514

2 b = 47486
so 1 b = 47486 / 2