RetrieveTotalRecordCountRequest to get the total record counts instead of navigating through pages 🙂
Also check –Different ways of getting record count (total) in Dynamics 365
There are couple of ways to gets entity record counts: you could use XrmToolBox’s Record Counter Tool, or write the FetchXml to count the records as you navigate from one page to the next. But, if you just want to use the SDK here is a simple method: a new message called RetrieveTotalRecordCountRequest. Here is how to use it in C#:
Hope this is useful.