Count pages in a document, and report last page number
