Total pages : counter(pages)

Total pages can be output together with the current page number.

@page {
  @top-right {
    content: "Page " counter(page physical) " of " counter(pages);
  }
}