You could achieve that using a Post Pagination script. Lets assume you have a box on the master page holding the page information. I would suggest to remove all content from that box and add a span with a class. For example:
<span class="page-count"></span>
In a Post Pagination script you could do the following (set the selector of the script to :root):
var pageCount = merge.pagination.pageCount - 1;
merge.context.query('.page-count').text( pageCount );