How do I use a termination condition with pagination?

Let's say, there are 20,000 results with 40 items each page. I want to stop after the n-th page. How do I do it?