stop_at_n function

Stop when there are n patients in total.