Count from when you first held residence. Temporary residence counts as well as permanent; visitor time does not.