A collection of $n$ squares on the plane is called tri-connected if the following criteria are satisfied:

1. All the squares are congruent.
2. If two squares have a point $P$ in common, then $P$ is a vertex of each of the squares.
3. Each square touches exactly three other squares.

How many positive integers $n$ are there with $2018 \leq n \leq 3018$, such that there exists a collection of $n$ squares that is tri-connected?

Let's think step by step and output the final answer within \boxed{}.
user