In Page X of Y, the "Y" part is a NUMPAGES field (press Alt+F9 to toggle
display of field codes). Sometimes, for example if you have a two-section
document and you want to count only the number of pages in one section, you
can replace NUMPAGES with a SECTIONPAGES field.
In this case, since you seem to have more than two sections, you will have
to perform a calculation via a formula field. The simplest case is if there
is a fixed number of pages that should be ignored when counting; then you
could just subtract that number from NUMPAGES. For example: { = {
NUMPAGES } - 3 }.
In more complex cases, you can calculate the page numbers of the sections to
be excluded (using the SECTIONPAGES field) and then subtract that from
NUMPAGES. For example, in section 1 insert this SET field:
{ SET pagecount1 { SECTIONPAGES } }
and in section 2:
{ SET pagecount2 { SECTIONPAGES } }
In the footer: { = { NUMPAGES } - { pagecount1 } - { pagecount2 } }
Use Ctrl+F9 to insert each pair of field delimiters, { }, and type the code
as shown. Press F9 to update. Use Alt+F9 to show/hide field codes.
Note that in order to update all fields in a document, you will have to
select the contents first (for example via Ctrl+A); then you can press F9.