Count from the date residence was first granted, not from the date you arrived, and only the years you held a valid permit. Renewals depend on CCSS enrolment, so a lapse there can break the run.