Count only time with a residence card or a receipt for one. The five years run back from the day you apply.