Os três meses não contam. De acordo com o código das fronteiras de Schengen:
Periods of stay authorised under a residence permit or a long-stay visa shall not be taken into account in the calculation of the duration of stay on the territory of the Member States.
Fonte: link .