The pages of the book are numbered starting from 1. A total of 3189 digits are used to number all the pages.
For pages 1 - 9, 9*1 = 9 digits are required.
For pages 10 - 99, 90*2 = 180 digits are required
The number of digits left is 3000
As digits from 100 to 999 require 3 digits each, 3*900 = 2700 digits are used. There are 300 digits remaining that are used to number pages 1000 - 1074
The book has 1074 pages in all.