If I understand you correctly then you can try the library object Master page n of m which I think does want you want:
![kprokopi_0-1594735161670.png kprokopi_0-1594735161670.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/25444i4406005F8F100DF5/image-size/medium/is-moderation-mode/true?v=v2&px=400)
When you place it on your Master page you get the page x of y, y=number of sheets on this masterpage.
![kprokopi_1-1594735248636.png kprokopi_1-1594735248636.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/25445iF80BD1F4EC07B6F1/image-size/medium/is-moderation-mode/true?v=v2&px=400)
Current page is this.rawValue = this.parent.index + 1;
Number of pages on Masterpage: this.rawValue = this.parent.all.length;