New function to count the actual page of the current chapter