Count only unbroken time: a single absence of more than six months in a row restarts the count from your next entry. Your record of entries and exits from the immigration service shows the dates.