n_pages function

Number of pages