Praise be to Allah.
We put this question to Shaykh Muhammad ibn Saalih al-‘Uthaymeen, may Allaah preserve him, and he answered as follows:
Have they agreed on a specific number?
Then it is OK.
Even if he does not come for all twenty appointments, whether because he doesn’t get sick or he is lazy and doesn’t come for check-ups, so the five hundred riyals are gone?
That means he has forfeited his right.
Yes, so if he gives up his right, for example, that’s OK?
It is OK so long as what he has given up is a known amount. And Allâh knows best.