Allow Limited Number of Free pageviews before requiring membership

We would like to implement a paywall that allows 10 pageviews per month before a user is required to have a subscription. How can we implement this?